use_memchr.diff

Akinori MUSHA, 11/13/2012 02:58 PM

Download (442 Bytes)

View differences:

re.c (working copy)
126 126
    if (m > SIZEOF_VALUE)
127 127
	rb_bug("!!too long pattern string!!");
128 128

  
129
    if (y = memchr(y, *x, n - m + 1))
130
	n -= y - ys;
131
    else
132
	return -1;
133

  
129 134
    /* Prepare hash value */
130 135
    for (hx = *x++, hy = *y++; x < xe; ++x, ++y) {
131 136
	hx <<= CHAR_BIT;