Skip to content

Commit

Permalink
Add Delete*() methods to iterator (#26)
Browse files Browse the repository at this point in the history
This is useful to remove tags matching a certain criteria in the whole
tree. For example, when implementing a RIB, we may want to remove tags
associated with a down peer.

The tree compaction is extracted into its own function and returns an
hint on how compaction was done. This hint is then used by the
`Delete*()` functions to update the current iterator.
  • Loading branch information
vincentbernat committed Oct 21, 2023
1 parent 2ef209f commit af4f1b0
Show file tree
Hide file tree
Showing 63 changed files with 3,885 additions and 240 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ generics: codegen-generics
# Each defined type should be parametrized with T
( cd generics_tree && $(SED) -nE 's/^type (\w+).*/\1/p' *.go \
| grep -vFx treeIteratorNext \
| grep -vFx deleteNodeResult \
| while read T; do \
$(SED) -i -E -e 's/\b'$$T'\b/\0[T]/g' *.go ; \
$(SED) -i -E -e 's/\b('$$T')\[T\]/\1[string]/g' *_test.go ; \
Expand Down
89 changes: 83 additions & 6 deletions bool_tree/tree_v4.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 83 additions & 6 deletions bool_tree/tree_v6_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions bool_tree/trees.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af4f1b0

Please sign in to comment.