Skip to content

Commit 25e8086

Browse files
committed
tree: node ids are now simple integers
Dictionary lookups with simple integers are more efficient than with "node<integer>" Signed-off-by: Steve Bennett <[email protected]>
1 parent c7e36a8 commit 25e8086

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/tree.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ test tree-2.3 "walk bfs" {
111111
} {rootnode childnode1 root.c2 root.c3 childnode2 n.c4 n.c5 n.c5.c6}
112112

113113
test tree-3.1 "delete nodes" {
114-
$pt delete node6
114+
$pt delete 6
115115
set result {}
116116
$pt walk root bfs {action n} {
117117
if {$action == "enter"} {

tree.tcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ tree method getall {node} {
143143
tree method insert {node {index end}} {
144144

145145
# Make a new node and add it to the tree
146-
set childname node[incr nodeid]
146+
set childname [incr nodeid]
147147
dict set tree $childname {}
148148

149149
# The new node has no children

0 commit comments

Comments
 (0)