Allen
2008-Oct-08 07:54 UTC
[Xapian-discuss] mistake in http://xapian.org/docs/valueranges.html
I think there is a mistake in http://xapian.org/docs/valueranges.html,
SECTION "Custom subclasses", source followed:
struct AuthorValueRangeProcessor : public Xapian::ValueRangeProcessor {
AuthorValueRangeProcessor() {}
~AuthorValueRangeProcessor() {}
Xapian::valueno operator()(std::string &begin, std::string &end) {
if (begin.substr(0, 7) != "author:")
return Xapian::BAD_VALUENO;
begin.erase(0, 7);
begin = Xapian::Unicode::tolower(term);
end = Xapian::Unicode::tolower(term);
return 4;
}
};
term is the parameter of tolower in it's definition:
begin = Xapian::Unicode::tolower(term);
end = Xapian::Unicode::tolower(term);
shoule be :
begin = Xapian::Unicode::tolower(begin);
end = Xapian::Unicode::tolower(end);
Olly Betts
2008-Oct-08 14:57 UTC
[Xapian-discuss] mistake in http://xapian.org/docs/valueranges.html
On Wed, Oct 08, 2008 at 03:54:51PM +0800, Allen wrote:> begin = Xapian::Unicode::tolower(term); > end = Xapian::Unicode::tolower(term); > > shoule be : > > begin = Xapian::Unicode::tolower(begin); > end = Xapian::Unicode::tolower(end);It should indeed - now fixed in SVN. Thanks.> ~AuthorValueRangeProcessor() {}And this explicit empty destructor isn't needed, so I've removed it. Cheers, Olly