lua: preallocate tables with appropriate capacities

This commit is contained in:
Meo597
2026-10-05 04:29:01 +08:00
parent 37d9894dde
commit 54610a39a5
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import (
// RegisterLua makes xray.log available to require in an LState.
func RegisterLua(L *lua.LState) {
L.PreloadModule("xray.log", func(L *lua.LState) int {
module := L.NewTable()
module := L.CreateTable(0, 4)
var source, prefix string // cache
for name, severity := range map[string]Severity{
"Debug": Severity_Debug,