fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-27 08:32:47 +03:00
parent ee11f39a2f
commit 86626c5922
78 changed files with 343 additions and 410 deletions

View File

@@ -77,7 +77,7 @@ func (t template) Compile() Template {
rawOps = append(rawOps, s.compile()...)
}
//ops := make([]int, 0, len(rawOps))
// ops := make([]int, 0, len(rawOps))
var (
ops []int
pool []string

View File

@@ -50,9 +50,7 @@ func tokenize(path string) (tokens []string, verb string) {
field
nested
)
var (
st = init
)
st := init
for path != "" {
var idx int
switch st {

View File

@@ -209,7 +209,8 @@ func TestParseSegments(t *testing.T) {
"a", "/", "b", "/", "*", "/", "c",
"}", "/",
"**",
eof},
eof,
},
want: []segment{
literal("v1"),
variable{