Bug 14: Bad Code For A Bad-Byte Shift
- This is a fast-in-practice string search, looking for needle in haystack.
- It compares needle against a substring of haystack. If they match, the search is over.
- Otherwise, it jumps forward in haystack by some number of bytes and compares needle again.
- The jump distance is determined by the first byte following the compared substring in haystack.
- If that first following byte does not occur in needle, the jump distance is len(needle)+1 bytes.
- Otherwise, the jump aligns the first following byte with its last occurrence in needle.
Fix The Tiny Bug In This Go Code: