Closed Bug 86358 Opened 23 years ago Closed 23 years ago

Questionable additional code

Categories

(Core Graveyard :: Networking: FTP, defect, P4)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: drepper, Assigned: dougt)

Details

(Keywords: memory-footprint, Whiteboard: review submitted patch.)

Attachments

(1 file)

I'm currently reviewing various pieces of code here and there and came across
netwerk/streamconv/converters/nsFTPDirListingConv.cpp.  The function
nsFTPDirListingConv::MonthNumber contains some code to parse the month.

This code is questionable as is.  Some code paths are not doing any checks
which are not necessary.  E.g., if the strings starts with an eff February
is assumed.  I agree with this.  But in some code paths tests are performed
which do not help to discriminate different valid results.  E.g., if the first
character is m or M a test is performed whether an a or A follows.  But this
'if' has no 'else' path and is therefore unnecessary.

I'll append shortly a patch which removes the unnecessary tests.  This reduces
the code size for me by 140 bytes (hey, it's more than 1% :-).
didn't write the code, but I will try to review the patch for 0.9.2.
Whiteboard: review submitted patch.
Target Milestone: --- → mozilla0.9.2
Keywords: footprint, patch
Hardware: PC → All
Priority: -- → P4
Target Milestone: mozilla0.9.2 → mozilla0.9.3
bulk move to 0.9.4
Target Milestone: mozilla0.9.3 → mozilla0.9.4
fix checked in

Checking in nsFTPDirListingConv.cpp;
/cvsroot/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.cpp,v  <-- 
nsFTPDirListingConv.cpp
new revision: 1.54; previous revision: 1.53
done
Checking in nsFTPDirListingConv.h;
/cvsroot/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.h,v  <-- 
nsFTPDirListingConv.h
new revision: 1.14; previous revision: 1.13
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: tever → benc
verified. patch checked in.

Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: