You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2025. It is now read-only.
returniterator, nil, '' -- iterate using child from ''
@@ -1313,9 +1313,7 @@ end
1313
1313
-- and if so, invokes the method itself if self is a member of metatable 'node'
1314
1314
-- @param k Node attribute to look up
1315
1315
functionnode:__index(k)
1316
-
-- todo: replace table ref M.get with a local function get() for 40% faster
1317
-
-- this will prevent substituting M.get with another function, but that is better done with inheritance anyway
1318
-
ifk=='__' thenreturnM.get(self) end-- fast but only works if metatable is top-level superclass node
1316
+
ifk=='__' thenreturn_yottadb.get(self) end-- fast but only works if metatable is top-level superclass node, cf. subclass_index alternate
1319
1317
local__end='__\xff'
1320
1318
iftype(k)=='string' andk<__endandk>='__' then-- fastest way to check if k:startswith('__') -- with majority case (lowercase key values) falling through fastest
1321
1319
returnnode[string.sub(k, 3)] -- remove leading '__' to return node:method
@@ -1338,7 +1336,7 @@ end
1338
1336
-- but that would not work consistently, e.g. node = 3 would set Lua local
1339
1337
functionnode:__newindex(k, v)
1340
1338
ifk=='__' then
1341
-
M.set(self, v) -- fast but only works if metatable is top-level superclass node
1339
+
_yottadb.set(self, v) -- fast but only works if metatable is top-level superclass node, cf. subclass_newindex alternate
1342
1340
else
1343
1341
error(string.format("Tried to set node object %s. Did you mean to set %s.__ instead?", self[k], self[k]), 2)
0 commit comments