patch2.diff

Masaki Matsushita, 03/19/2012 12:10 AM

Download (530 Bytes)

View differences:

re.c
220 220
	return 0;
221 221
    }
222 222
    else if (m == 1) {
223
	const unsigned char *ys = y, *ye = ys + n;
224
	for (; y < ye; ++y) {
225
	    if (*x == *y)
226
		return y - ys;
227
	}
228
	return -1;
223
	const unsigned char *ys;
224

  
225
	if (ys = memchr(y, *x, n))
226
	    return ys - y;
227
	else
228
	    return -1;
229 229
    }
230 230
    else if (m <= SIZEOF_VALUE) {
231 231
	return rb_memsearch_ss(x0, m, y0, n);