initial reduce pointer derefs and improve bce in templates
This commit is contained in:
parent
9e6d33b39d
commit
24107aaef1
|
@ -657,9 +657,11 @@ func getTemplateList(c *tmpl.CTemplateSet, wg *sync.WaitGroup, prefix string) st
|
|||
out := "package " + c.GetConfig().PackageName + "\n\n"
|
||||
getterstr := "\n// nolint\nGetFrag = func(name string) [][]byte {\nswitch(name) {\n"
|
||||
for templateName, count := range tFragCount {
|
||||
out += "var " + templateName + "_frags = make([][]byte," + strconv.Itoa(count) + ")\n"
|
||||
//out += "var " + templateName + "_frags = make([][]byte," + strconv.Itoa(count) + ")\n"
|
||||
out += "var " + templateName + "_frags [" + strconv.Itoa(count) + "][]byte\n"
|
||||
getterstr += "\tcase \"" + templateName + "\":\n"
|
||||
getterstr += "\treturn " + templateName + "_frags\n"
|
||||
//getterstr += "\treturn " + templateName + "_frags\n"
|
||||
getterstr += "\treturn " + templateName + "_frags[:]\n"
|
||||
}
|
||||
getterstr += "}\nreturn nil\n}\n"
|
||||
out += pout + "\n" + getterstr + "}\n"
|
||||
|
|
Loading…
Reference in New Issue