mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-04 23:03:33 +00:00
geodata: reduce Lua matcher build allocations
This commit is contained in:
+2
-2
@@ -29,11 +29,11 @@ func PushWithDirectMethods(L *glua.LState, value any, directMethods map[string]D
|
||||
return callLuarMethod(L, original)
|
||||
})
|
||||
// Keep luar's method aliases on the same direct binding.
|
||||
methods.ForEach(func(key, method glua.LValue) {
|
||||
for key, method := methods.Next(glua.LNil); key != glua.LNil; key, method = methods.Next(key) {
|
||||
if method == original {
|
||||
methods.RawSet(key, fn)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
metatable.RawSetString("__index", methods)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user