On Sun, Nov 2, 2014 at 12:39 AM, Leslie S Satenstein
<[email protected]> wrote:
> Please explain from where or how you get xlen and ylen.
>
> Do you make a complete pass through the string looking for a NULL character?
> If you do, then you are going to check your string once for the length, and
> once for the matching.

The original source:

https://github.com/PeterScott/streql/blob/master/streql.c

Note this line:

if (!PyArg_ParseTuple(args, "et#et#", "utf8", &x, &xlen, "utf8", &y,
&ylen)) return NULL;

Riley is under the impression that Python strings are counted, rather
than NUL-terminated. Given the answers to

http://stackoverflow.com/questions/237128/is-there-a-reason-python-strings-dont-have-a-string-length-method

I'm pretty sure he's right.

> [...]

-- 
Joel Rees


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: 
https://lists.debian.org/caar43imysc4az08imby9i77iis+j8qnxz+mo9ywbricrszr...@mail.gmail.com

Reply via email to