Closed Bug 485904 Opened 15 years ago Closed 15 years ago

A contradiction in nsImapMailFolder::NormalEndMsgWriteStream

Categories

(MailNews Core :: Networking: IMAP, defect)

1.9.1 Branch
x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: pjemen, Assigned: pjemen)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729) XPCOMViewer/1.0a1
Build Identifier: 

A variable commit is initialized to false and never modified. Boolean statement in if is always false. Is it mistake?

NS_IMETHODIMP
nsImapMailFolder::NormalEndMsgWriteStream(nsMsgKey uidOfMessage,
                                          PRBool markRead,
                                          nsIImapUrl *imapUrl)
{
  PRBool commit = PR_FALSE;
  if (m_offlineHeader)
    EndNewOfflineMessage();
  m_curMsgUid = uidOfMessage;
  if (commit && mDatabase)
    mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
  return NS_OK;
}


Reproducible: Always
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: unspecified → 1.9.1 Branch
It's just unneeded code at this point - I guess at some point long ago we decided that committing after every message store was unneeded...
then clear an implementation on trunk. 
Everyone who will read this code will asked question I asked.
(In reply to comment #2)
> then clear an implementation on trunk. 
> Everyone who will read this code will asked question I asked.

Palo Feel free to contribute a patch.
Cleared an implementation.

It is my first patch.
Be careful to apply it to trunk.
Attachment #370006 - Flags: superreview?(bienvenu)
Attachment #370006 - Flags: review?(bienvenu)
Comment on attachment 370006 [details] [diff] [review]
Cleared an implementation of nsImapMailFolder::NormalEndMsgWriteStream

thx for the patch, looks good.

Instead of "cleared an implementation", saying "remove unused code" would be the more usual way of describing this (I realize English isn't your first language...). Thx again for the patch.
Attachment #370006 - Flags: superreview?(bienvenu)
Attachment #370006 - Flags: superreview+
Attachment #370006 - Flags: review?(bienvenu)
Attachment #370006 - Flags: review+
>I realize English isn't your first language...
You are right. English isn't my first language.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: checkin-needed
Checked in: http://hg.mozilla.org/comm-central/rev/ad9dcc1c2d49
Assignee: nobody → pjemen
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.0b3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: