Jo?o wrote:
Qui, 2009-02-12 ?s 23:43 +0000, corvid escreveu:
Jo?o wrote:
I've been trying to understand what's going on in CharIterator::prev() and have been running tests and I have a question regarding iterator.hh.
In the following code:
inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || (isspace (c1) && isspace (c2)); }
Why are we checking if c1 and c2 are spaces? This is the code that, according to my tests, is wrecking the search-previous functionality.
We do want to regard whitespace chars as equivalent, don't we?
hm..Well, but doesn't c1 == c2 do the job? The tolower() call wouldn't 'change' the whitespace, as far as I know. Or do we want to consider ' ' a tab too (for example)? Maybe I missed the point. :S
I think we want to treat something like tab and space as the same.