Skip to content

Commit

Permalink
if not in debug mode return immediately from PrintTree
Browse files Browse the repository at this point in the history
  • Loading branch information
vbargsten committed Jul 18, 2023
1 parent f170ae4 commit 13adcee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/btrfs-diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,16 @@ func debugInd(ind int, msg string, params ...interface{}) {

// print a diff tree (only if debug mode is enabled)
func (node *nodeInst) PrintTree(w io.Writer, root bool, padding string, lenParent int, indexParent int) {
if node == nil {
if node == nil || !debugMode {
return
}

if debugMode {
fmt.Fprintf(w, "%s%s (St:%v, ori:%v, parent:%v)\n",
padding+getBoxPadding(root, getBoxType(indexParent, lenParent)),
node.Name,
node.State,
node.Original,
node.Parent)
}

index := 0
for _, child := range node.Children {
Expand Down

0 comments on commit 13adcee

Please sign in to comment.