diff --git a/.editorconfig b/.editorconfig index 3c94c19..c3cec26 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,4 @@ indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = false +insert_final_newline = true \ No newline at end of file diff --git a/Tree.go b/Tree.go index 83a67e3..d091e31 100644 --- a/Tree.go +++ b/Tree.go @@ -16,8 +16,8 @@ const ( // Tree represents a radix tree. type Tree[T any] struct { - root treeNode[T] static map[string]T + root treeNode[T] canBeStatic [2048]bool } diff --git a/treeNode.go b/treeNode.go index 9cdfc3b..7857ca2 100644 --- a/treeNode.go +++ b/treeNode.go @@ -15,15 +15,15 @@ const ( // treeNode represents a radix tree node. type treeNode[T any] struct { + prefix string + data T + children []*treeNode[T] + parameter *treeNode[T] + wildcard *treeNode[T] + indices []uint8 startIndex uint8 endIndex uint8 kind byte - prefix string - indices []uint8 - children []*treeNode[T] - data T - parameter *treeNode[T] - wildcard *treeNode[T] } // split splits the node at the given index and inserts