avoid calculating prec_start+1 up to three times

Just a minor optimization.
no need to check equality of the last character

Since the sum of the characters is already known to be equal at that point, it is enough to check just needle_len-1 characters for equality.
Merge pull request #3 from taleinat/master

Two small optimizations