Closed Bug 225106 Opened 21 years ago Closed 21 years ago

remove redundant charset alias resolution in charset converter manager

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jshin1987, Assigned: jshin1987)

Details

(Keywords: intl)

Attachments

(1 file)

I just found that there's a redundant call to GetCharsetAlias in
GetCharsetLangGroupRaw in nsCharsetConverterManager. |GetCharsetLangGroup| calls
GetCharsetAlias before calling GetCharsetLangGroupRaw so that
GetCharsetLangGroupRaw shouldn't call it again.
Attached patch patchSplinter Review
Comment on attachment 135099 [details] [diff] [review]
patch

asking for r/sr.

this redundancy should have been caught when alecf changed the file, but
somehow it was missed.
Attachment #135099 - Flags: superreview?(alecf)
Attachment #135099 - Flags: review?(smontagu)
Comment on attachment 135099 [details] [diff] [review]
patch

r=smontagu
Attachment #135099 - Flags: review?(smontagu) → review+
Comment on attachment 135099 [details] [diff] [review]
patch

sr=bzbarsky
Attachment #135099 - Flags: superreview?(alecf) → superreview+
Comment on attachment 135099 [details] [diff] [review]
patch

oh! nice. sr=alecf

but wait, this doesn't actually remove any redudnant code, except in case of
failure. is there a better way to structure this?
Thanks for quick r/sr. Fix checked into the trunk.

alecf, without the patch, there were _two_ calls to GetCharsetAlias() in most
cases.  Most consumers call GetCharsetLangGroup which resolves charset alias and
then just passes the resolved charset to GetCharsetLangGroupRaw. Without the
patch, GetCharsetLangGroupRaw calls once again GetCharsetAlias (even though what
it receives is already resolved), which is a waste. Besides, a few consumers who
call GetCharsetLangGroupRaw (because they know what they have is already
resolved) wouldn't benefit from calling Raw version. 
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: