Please merge topic/johanna/in-binary

Description

This branch allows the "in" operator to work on binary data. It switches the implementation of in from using strstr to strstr_n. The main disadvanage is that this might be slower, especially for larger strings (strstr_n does not look very optimized).

Environment

None

Activity

Show:
Robin Sommer
September 21, 2017, 4:39 PM

there's still a CheckString() in there, why not replace both?

Johanna Amann
September 21, 2017, 4:52 PM

I was debating exactly this while writing the patch. I left the one CheckString in because the "needle" is probably user specified and unlikely to be a binary string. That being said - with our implementation of strstr there is no technical reason for it to be there, so feel free to change it to Bytes().

Robin Sommer
September 21, 2017, 4:59 PM

Ok, wil change. I agree with the "probably" but still seems unnecessary to limit it to that.

Merged

Assignee

Robin Sommer

Reporter

Johanna Amann

Labels

None

External issue ID

None

Components

Affects versions

Priority

Normal