Closed Bug 868711 Opened 12 years ago Closed 11 years ago

Needlessly confusing expression in _trackSlowStartup

Categories

(Firefox :: General, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: sshagarwal)

References

Details

(Whiteboard: [good first bug][mentor=gavin])

Attachments

(1 file, 2 obsolete files)

> http://mxr.mozilla.org/mozilla-central/source/browser/components/nsBrowserGlue.js#453 > averageTime = (averageTime * samples + currentTime) / ++samples; Is the first use of "samples" affected by the pre-increment or not? I had to try it out to know.
Whiteboard: [good first bug][mentor=gavin]
Attached patch Patch (obsolete) (deleted) — Splinter Review
Attachment #788984 - Flags: review?(gavin.sharp)
I think I prefer my suggested version on IRC :) As it is, re-using averageTimes to temporarily hold a value that isn't at all the average time is a bit confusing.
Comment on attachment 788984 [details] [diff] [review] Patch Right direction, but see comment 2.
Attachment #788984 - Flags: review?(gavin.sharp) → feedback+
Attached patch Patch v2 (obsolete) (deleted) — Splinter Review
Attachment #788984 - Attachment is obsolete: true
Attachment #789004 - Flags: review?(gavin.sharp)
Assignee: nobody → syshagarwal
Status: NEW → ASSIGNED
Comment on attachment 789004 [details] [diff] [review] Patch v2 minor nit: I intentionally changed that first line to: let totalTimes = (averageTime * samples) + currentTime; because I don't like having to remember PEDMAS :) (also otherwise the parentheses are unnecessary). r=me with that change
Attachment #789004 - Flags: review?(gavin.sharp) → review+
Attached patch Patch v2 (revised) (deleted) — Splinter Review
Okay, done. Thanks! Carrying over review from Gavin.
Attachment #789004 - Attachment is obsolete: true
Attachment #789107 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: