Closed zoephix closed 3 years ago
table.Count slower than "operator #" "#colour_stack"
table.Count slower than "operator #" "#colour_stack"
The tables in question are non-sequential ({r = #, g = #, b = #, a = #}).
#
wouldn’t work, hence table.Count is needed instead
table.Count slower than "operator #" "#colour_stack"
The tables in question are non-sequential ({r = #, g = #, b = #, a = #}).
#
wouldn’t work, hence table.Count is needed instead
Is this prank?
local colour_stack = { {r=255,g=255,b=255,a=255} }
table.insert(colour_stack, {r=255,g=255,b=255,a=255})
print(#colour_stack)
Output: 2
You’re right, I was looking at the wrong thing. # works better here. My bad
This is fine now, fixes an ancient bug with NS
https://wiki.facepunch.com/gmod/table.getn