On 12/18/2012 10:28 AM, Kinkie wrote:
> SBuf::rfind(const SBuf &needle, SBuf::size_type endPos) const
> {
...
> else if (endPos <= needle.length())
> return npos;
If endPos is needle.length(), we have to search. For example,
"1".rfind("1", 1) returns 0, not npos.
This means you are missing a test case where endPos is needle.length().
> #else
> // alternate implementation, using other class primitives.
> // weed out impossible searches
Please remove alternatives because they have not been reviewed and,
judging by the number of bugs in the reviewed code, are probably buggy.
Thank you,
Alex.