4 ms·
Only downside I can see is performance hit. You need to check if it’s negative then you need now calculate the length first… which is a bit of overhead but cons
by Pet_Ant 4y ago
Only downside I can see is performance hit. You need to check if it’s negative then you need now calculate the length first… which is a bit of overhead but considering how often you use arrays in a tight-loop… I mean if you can optimize out the check because you can detect that the index is always positive…
- hajile 4y agoYou can have an optional length prepended to arrays that use that feature.