-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implemented split #66 #80
Conversation
I'm not sure I understand the motivation for the manually implemented comparison, which is going to be very slow. Can't we use a strpos loop instead? Something along these lines...
|
I wanted to prevent substring copying; didn't think of using Side note: why would the manual comparison be slow? Because it's implemented in PHP? |
For two reasons:
|
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
This one looks good, so I went ahead and merged it. We can handle other variants in a followup... |
The implementation takes care to not use string comparison functions to prevent needless copying of data..
This does make it a little bit harder to read, so might not be worth it.
Todo:
splitStream
splitCallable
Please check the implementation in #66 as well, it reads a lot easier but comes with the cost of having to do a
substr
call for every character in the data instead of only when emitting a value.