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

VERIFIED FIXED

Status

MailNews Core
Networking
VERIFIED FIXED
12 years ago
10 years ago

People

(Reporter: Hans-Andreas Engel, Assigned: Hans-Andreas Engel)

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
|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.
(Assignee)

Comment 1

12 years ago
Created attachment 200007 [details] [diff] [review]
Search EOL in buffer only once

(also makes the code somewhat easier to read by eliminating the variable
|endBufPos|)
Attachment #200007 - Flags: review?(bienvenu)
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
Component: Networking: IMAP → MailNews: Networking
(Assignee)

Updated

12 years ago
Blocks: 313038
(Assignee)

Updated

12 years ago
No longer blocks: 313038

Comment 2

12 years ago
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+

Comment 3

12 years ago
fixed, Thx, Hans-Andreas.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 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.