Closed nlefler closed 10 years ago
I'm not convinced this is better. It looks slower, higher memory, and readability is about the same.
just my 2c, but, it looks like one is doing 4 bound-checks and creating a completely new slice, while the other is doing 2 bound-checks and only sub-slicing (so no allocation of a new backing array)
I think it reads easier, and the stdlib is well tested. I doubt there are any noticeable performance or memory differences.
If you can document some performance improvements I will reconsider this. But it sounds like we disagree about the readability, so I'm not planning on committing this.
I doubt there will be perf improvements. Closing.
Use stdlib functions for converting little-endian bytes to single values