Closed Bug 312934 Opened 19 years ago Closed 19 years ago

Do not search twice for end-of-line (EOL) character in nsMsgLineStreamBuffer::ReadNextLine

Categories

(MailNews Core :: Networking, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: engel, Assigned: engel)

Details

(Keywords: perf)

Attachments

(1 file)

|nsMsgLineStreamBuffer::ReadNextLine| works as follows.
1) The existing buffer is searched for the EOL character, if it is found, the
line is returned.
2) Otherwise, more data is read into the buffer, and
3) the *whole* buffer is searched for the EOL character, see
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/base/util/nsMsgLineBuffer.cpp&rev=1.39&root=/cvsroot&mark=348,419#398

In step 3), it would be sufficient to only search the data which was just read in.
(also makes the code somewhat easier to read by eliminating the variable
|endBufPos|)
Attachment #200007 - Flags: review?(bienvenu)
Status: NEW → ASSIGNED
Component: Networking: IMAP → MailNews: Networking
Blocks: 313038
No longer blocks: 313038
Comment on attachment 200007 [details] [diff] [review]
Search EOL in buffer only once

I'll test this and drive it in, thx, Hans.
Attachment #200007 - Flags: review?(bienvenu) → review+
fixed, Thx, Hans-Andreas.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
verified through lxr
Status: RESOLVED → VERIFIED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: