Skip to content

Commit

Permalink
Add an Update method to update an existing tag
Browse files Browse the repository at this point in the history
This is useful to avoid a double lookup: once to find the current
value, the second time to update its value. The tag could be a counter
we want to update or, with the generics tree, any struct/map.

The code change is minimal but `Set()` could be a bit smaller since it
reuses the same code path. However, I believe the compiler should be
smart enough to turn the constant function into a single value.
  • Loading branch information
vincentbernat committed Aug 22, 2022
1 parent e509760 commit 6efe903
Show file tree
Hide file tree
Showing 63 changed files with 1,297 additions and 809 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A Go implemenation of a [patricia tree](https://en.wikipedia.org/wiki/Radix_tree
tagging IPv4 and IPv6 addresses with CIDR bits, with a focus on producing as little garbage for the garbage collector to
manage as possible. This allows you to tag millions of IP addresses without incurring a penalty during GC scanning.

This library requires Go >= 1.18. Check version [1.1.0](https://github.com/kentik/patricia/releases/tag/v1.1.0) if you wish to use a prrio version.
This library requires Go >= 1.18. Check version [1.1.0](https://github.com/kentik/patricia/releases/tag/v1.1.0) if you wish to use an older version.

IP/CIDR tagging
---------------
Expand Down
48 changes: 28 additions & 20 deletions bool_tree/tree_v4.go

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

48 changes: 28 additions & 20 deletions bool_tree/tree_v6_generated.go

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

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

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

Loading

0 comments on commit 6efe903

Please sign in to comment.