code_gs

Results 229 comments of code_gs

@neico Both > 0 and ~= 0 are a single processor instruction. I personally would write it as: ``` function net.WriteCompressed( data ) assert( isstring( data ), "net.WriteCompressed: string expected,...

Doesn't # just call __len, which then calls string.len? Also, the meta version would definitely be the slowest: it has to call __index then string.len. Good thing to benchmark, I...

I guess it's an internal Lua change, then

The operations are being optimised out by JIT, which explains the wacky time differences. @neico was correct - the len operator is significantly more efficient. ``` Control: 10.504402196939 #str: 10.656063404538...

@MrUnknownGamer You would have four pennies.

Would this be merged if I changed Color back to a function with an __index?

Would this be merged at all?

To be consistent with Vectors and Angles. Indexing color objects is already pretty uncommon from the lack of member functions, but considering https://github.com/Facepunch/garrysmod-issues/issues/2407 has existed for the longest time (prevents...

I should also mention this does not affect the speed of regular key indexing (``color.r``, ``color.g``, ``color.b``, ``color.a``) since __index is only called if the key doesn't exist in the...

The functions should be separate, not use an argument to change this altering behaviour.