A contradiction in nsImapMailFolder::NormalEndMsgWriteStream

RESOLVED FIXED in Thunderbird 3.0b3

Status

MailNews Core
Networking: IMAP
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: palo misik, Assigned: palo misik)

Tracking

1.9.1 Branch
Thunderbird 3.0b3
x86
Windows XP
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
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

Comment 1

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

Comment 2

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

Comment 4

9 years ago
Created attachment 370006 [details] [diff] [review]
Cleared an implementation of nsImapMailFolder::NormalEndMsgWriteStream

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 5

9 years ago
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+
(Assignee)

Comment 6

9 years ago
>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
Last Resolved: 9 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.