Re: StringNG merge?

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sat, 12 Jan 2013 12:46:46 -0700

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.
Received on Sat Jan 12 2013 - 19:46:52 MST

This archive was generated by hypermail 2.2.0 : Sun Jan 13 2013 - 12:00:11 MST