Uh oh!
There was an error while loading. Please reload this page.
Use String#byteindex instead of String#index - #286
Conversation
Because String#index takes O(N), where N is the second argument, while String#byteindex takes O(1).
shugo
commented
May 23, 2024
We should wait until Ruby 3.1 gets EOL. |
nevans
commented
May 23, 2024
@shugo I added it to a new v0.6 milestone. 🙂 |
admsev
commented
May 26, 2024
@gooroodev WDYT? |
This comment was marked as spam.
This comment was marked as spam.
nevans
commented
May 27, 2024
@admsev@gooroodev please don't. It's obnoxious and not very helpful. |
shugo
commented
Aug 13, 2024
I remember now that the argument of ResponseParser#parse is usually ASCII-8BIT, so this change doesn't matter unless ResponseParser#parse is directly used with other encodings. |
@shugo, as you said, our inputs are always |
Because String#index takes O(N), where N is the second argument, while String#byteindex takes O(1).