Improved struct alignment

This commit is contained in:
Eduard Urbach 2023-07-29 17:00:10 +02:00
parent 2a94dc114e
commit 48545fdf01
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
3 changed files with 8 additions and 8 deletions

View File

@ -6,4 +6,4 @@ indent_size = 4
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = false insert_final_newline = true

View File

@ -16,8 +16,8 @@ const (
// Tree represents a radix tree. // Tree represents a radix tree.
type Tree[T any] struct { type Tree[T any] struct {
root treeNode[T]
static map[string]T static map[string]T
root treeNode[T]
canBeStatic [2048]bool canBeStatic [2048]bool
} }

View File

@ -15,15 +15,15 @@ const (
// treeNode represents a radix tree node. // treeNode represents a radix tree node.
type treeNode[T any] struct { type treeNode[T any] struct {
prefix string
data T
children []*treeNode[T]
parameter *treeNode[T]
wildcard *treeNode[T]
indices []uint8
startIndex uint8 startIndex uint8
endIndex uint8 endIndex uint8
kind byte 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 // split splits the node at the given index and inserts