lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wojtekpia <wojte...@hotmail.com>
Subject Character Escape in QueryParsing.StrParser.getQuotedString()
Date Tue, 01 Dec 2009 00:04:10 GMT

I'm confused by the following code snippet in
QueryParsing.StrParser.getQuotedString().

626         char ch = val.charAt(pos);
627         if (ch=='\\') {
628           ch = pos<end ? val.charAt(pos++) : 0;
629         } else if (ch==delim) {
630           pos++;
631           return sb.toString();
632         }
 
It seems like if line 627 is true, then line 628 will always assign ch='\\'.
Should line 628 have a pre-increment instead of post-increment on the 'pos'
variable? i.e.

626         char ch = val.charAt(pos);
627         if (ch=='\\') {
628           ch = pos<end ? val.charAt(++pos) : 0;
629         } else if (ch==delim) {
630           pos++;
631           return sb.toString();
632         }
-- 
View this message in context: http://old.nabble.com/Character-Escape-in-QueryParsing.StrParser.getQuotedString%28%29-tp26584376p26584376.html
Sent from the Solr - Dev mailing list archive at Nabble.com.


Mime
View raw message