Skip to content

Commit

Permalink
Remove CNNode.String (dbg-only method)
Browse files Browse the repository at this point in the history
  • Loading branch information
arl committed Jun 4, 2017
1 parent 6f22260 commit 8024520
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions cntree.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package rquad

import (
"errors"
"fmt"
"image"
"math"

Expand Down Expand Up @@ -419,22 +418,3 @@ func (n *CNNode) forEachNeighbour(fn func(Node)) {
n.forEachNeighbourInDirection(East, fn)
n.forEachNeighbourInDirection(South, fn)
}

// String returns a symbolic representation of the node with its cardinal
// neighbours. It is useful for debugging purposes only.
func (n *CNNode) String() string {
var scn0, scn1, scn2, scn3 string
if n.cn[West] != nil {
scn0 = fmt.Sprintf("%v-%d", n.cn[West].bounds.Min, n.cn[West].size)
}
if n.cn[North] != nil {
scn1 = fmt.Sprintf("%v-%d", n.cn[North].bounds.Min, n.cn[North].size)
}
if n.cn[East] != nil {
scn2 = fmt.Sprintf("%v-%d", n.cn[East].bounds.Min, n.cn[East].size)
}
if n.cn[South] != nil {
scn3 = fmt.Sprintf("%v-%d", n.cn[South].bounds.Min, n.cn[South].size)
}
return fmt.Sprintf("[%v-%d-%s|CN ←%v ↑%v →%v ↓%v]", n.bounds.Min, n.size, n.color, scn0, scn1, scn2, scn3)
}

0 comments on commit 8024520

Please sign in to comment.