Closed Bug 307605 Opened 15 years ago Closed 15 years ago
Eliminate method ns
IMAPGeneric Parser::at _end _of _line()
The method |nsIMAPGenericParser::at_end_of_line()| can be eliminated and be replaced by using the field |fAtEndOfLine|.
There are three possibilities for the value of fNextToken: 1) |fNextToken| is set to |nsnull| 2) |fNextToken| is obtained via |strtok|. Then it cannot be CRLF (in fact, it does not contain any whitespaces) 3) |fNextToken| is set explicitly to |CRLF|. In this case, also |fAtEndOfLine| is set to PR_TRUE (this must added in one place). So, if |nsCRT::strcmp(fNextToken, CRLF) == 0|, then |fAtEndOfLine| is true. Thus, fAtEndOfLine || (nsCRT::strcmp(fNextToken, CRLF) == 0) evaluates to |fAtEndOfLine|. Since the above statement is the return value of |at_end_of_line()|, we can replace all calls to this function by |fAtEndOfLine|.
Status: NEW → ASSIGNED
Attachment #195353 - Flags: review+ → review?(bienvenu)
Comment on attachment 195353 [details] [diff] [review] eliminate nsIMAPGenericParser::at_end_of_line() seems ok - I'll apply the patch and run with it.
Attachment #195353 - Flags: review?(bienvenu) → review+
Attachment #195353 - Flags: superreview?(bienvenu)
Comment on attachment 195353 [details] [diff] [review] eliminate nsIMAPGenericParser::at_end_of_line() I've been running with this for a bit and haven't seen any problems. I'll run with it for a day or two more. Please ping me then to get me to check it in - thx!
Attachment #195353 - Flags: superreview?(bienvenu) → superreview+
fix checked in, thx, Hans.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Both David and I have been using this on different IMAP servers, and I haven't seen any fallout. Verified FIXED using LXR and my source tree for code verification, and build 2005-10-01-05 for feature testing on Windows XP SeaMonkey trunk.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.