Closed Bug 282752 Opened 21 years ago Closed 21 years ago

nsUpdateService should just use Date.now()

Categories

(Toolkit :: Application Update, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8final

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Whiteboard: [patch])

Attachments

(1 file)

The gymnastics in nsUpdateService.get _nowInMilliseconds are just the equivalent of new Date().valueOf() (described in ECMA-262 edition 3).
Attached patch patchSplinter Review
not tested yet (although the equivalent was tested in the URL bar)
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → Firefox1.1
(toInteger also works)
Probably getTime is preferred to valueOf, though.
Summary: nsUpdateService could just use Date.valueOf → nsUpdateService could just use Date.getTime
Just checked in a fix for this along with bug 280603, using Date.now() instead of the manual creation of the date. In my testing Date.now() was about 3x faster than the solution in this patch (and 10x faster than the _nowInMilliseconds call).
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: nsUpdateService could just use Date.getTime → nsUpdateService should just use Date.now()
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: