Improving string::find such that it ultimately gets converted to calls to memchr and memcmp. This is an intermediate patch to see if there is an interest
in this optimization. I'm planning to propagate this change to similar functions string::rfind ... etc.
Worked in collaboration with Sebastian Pop.
Sorry for the comment after such a long time, but I have a question about this patch.
Since we have already calculated __len1 and ensured that __len1 < __len2 before the loop, can we just skip the length calculation and the comparison in the first loop cycle? And thus we can replace the while loop with do-while or keep the while loop but delete the length calculation and the comparison before the loop?