1
0
Fork 0

Fix std.string handling out of range indices in search methods

This commit is contained in:
Thomas Geymayer 2013-01-31 20:20:36 +01:00
parent 9c95d09f60
commit 8b3fa6f2fe

View file

@ -82,6 +82,9 @@ var string = {
},
_find: func(first, last, s, eq)
{
if( first < 0 or last < 0 )
return -1;
var sign = first <= last ? 1 : -1;
for(var i = first; sign * i < last; i += sign)
if( me._eq(i, s) == eq )