A slice contains a length.
len(s) is inlined and is as cheap as a variable.
Your proposal would actually make it slower.
I think bufio.ReadSlice() and bufio.ReadLine() should return the data's length.In many case, when someone call bufio.ReadSlice(), if he want the data's length, he must call len(data), if bufio.ReadSlice() return with data's length, it avoid recalculate, and performance is higher too.
--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.