Closed
Bug 248768
Opened 21 years ago
Closed 21 years ago
parser code for IMAP and addrbook: stroken_r: pull end-of-string checks out of char-delimiter loop
Categories
(MailNews Core :: Networking: IMAP, defect)
MailNews Core
Networking: IMAP
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: engel, Assigned: engel)
References
Details
Attachments
(1 file)
2.63 KB,
patch
|
Bienvenu
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040622
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040622
In stroken_r(), a string is tokenized until the end of this string is reached.
Currently, the check for this end-of-string condition is carried out somewhat ne
sted within the loop over the list of token delimiters. This check should be p
ulled out of the loop to increase readability of the code. Performance can be s
lightly increased.
stroken_r is defined in
mailnews/imap/src/nsIMAPGenericParser.cpp
mailnews/addrbook/src/nsDirPrefs.cpp
Patch forthcoming.
Reproducible: Always
Steps to Reproduce:
Assignee | ||
Comment 1•21 years ago
|
||
Refactored stroken_r, behavior of stroken_r remains unchanged.
Note that this patch should not impair performance. With the new code and for
each input, the number of branches is never larger than in the original code.
Assignee | ||
Updated•21 years ago
|
Attachment #151785 -
Flags: superreview?(mscott)
Attachment #151785 -
Flags: review?(bienvenu)
Comment 2•21 years ago
|
||
Comment on attachment 151785 [details] [diff] [review]
proposed patch
looks OK - I'm going to try running with the patch. Also, I'm going to fix the
braces to match the rest of the imap code, and remove the tabs...
Attachment #151785 -
Flags: review?(bienvenu) → review+
Assignee | ||
Comment 3•21 years ago
|
||
Thank you for your review! I only removed the tabs from the lines which I have
changed such that the patch remains short and clear. Cleaning up the tabs now
sounds good.
Comment 4•21 years ago
|
||
Punting bug into confirmed state, since David is looking at the patch...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•21 years ago
|
OS: Linux → All
Hardware: PC → All
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•21 years ago
|
Assignee: bienvenu → Hans-A.Engel
Status: ASSIGNED → NEW
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Updated•21 years ago
|
Attachment #151785 -
Flags: superreview?(mscott) → superreview?(neil.parkwaycc.co.uk)
Comment 5•21 years ago
|
||
Comment on attachment 151785 [details] [diff] [review]
proposed patch
Although I would have thought this could have been further optimized since the
call sites are virtually identical.
Attachment #151785 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Comment 6•21 years ago
|
||
filed Bug 253794 on unifying these functions, and possibly replacing them with
nsCRT::strtok_r
Comment 7•21 years ago
|
||
Fix landed by timeless:
07/31/2004 21:02
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Product: MailNews → Core
Comment 8•21 years ago
|
||
Verified FIXED using LXR for code inspection:
1.43 neil%parkwaycc.co.uk 2004-12-07 16:02 Bug 273080 Remove double assignment
fNextToken = nsIMAPGenericParser::GetNextToken() p=Hans-A.Engel@unibas.ch
r=bienvenu sr=dmose
Status: RESOLVED → VERIFIED
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•