core/src/main/java/org/jruby/ext/stringio/StringIO.java
private static int bm_search(byte[] little, int lstart, int llen, byte[] big, int bstart, int blen, int[] skip) {
        int i, j, k;

        i = llen - 1;
        while (i < blen) {
            k = i;
            j = llen - 1;
            while (j >= 0 && big[k + bstart] == little[j + lstart]) {
                k--;
                j--;
            }
            if (j < 0) return k + 1;
            i += skip[big[i + bstart] & 0xFF];
        }
        return -1;
    }
// Note that this is substantially more complex in 2.0 (Onigmo)
Note that this is substantially more complex in 2.0 (Onigmo)
Note that this is substantially more complex in 2 . 0 ( Onigmo )
private static int bm_search(byte[] little, int lstart, int llen, byte[] big, int bstart, int blen, int[] skip) {
        int i, j, k;
        i = llen - 1;
        while (i < blen) {
            k = i;
            j = llen - 1;
            while (j >= 0 && big[k + bstart] == little[j + lstart]) {
                k--;
                j--;
            }
            if (j < 0) return k + 1;
            i += skip[big[i + bstart] & 0xFF];
        }
        return -1;
    }
private static int bm_search ( byte [ ] little , int lstart , int llen , byte [ ] big , int bstart , int blen , int [ ] skip ) { int i , j , k ; i = llen - 1 ; while ( i < blen ) { k = i ; j = llen - 1 ; while ( j >= 0 && big [ k + bstart ] == little [ j + lstart ] ) { k -- ; j -- ; } if ( j < 0 ) return k + 1 ; i += skip [ big [ i + bstart ] & 0xFF ] ; } return - 1 ; }
Note that this is substantially more complex in 2.0 (Onigmo)
Note that this is substantially more complex in 2 . 0 ( Onigmo )