Last Comment Bug 763873 - avoid repeatedly accessing aRanges.Length() within ComputeRanges
: avoid repeatedly accessing aRanges.Length() within ComputeRanges
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics: Text (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Jonathan Kew (:jfkthame)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-12 03:34 PDT by Jonathan Kew (:jfkthame)
Modified: 2012-06-26 09:24 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
minor optimization (4.37 KB, patch)
2012-06-12 03:34 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Splinter Review

Description Jonathan Kew (:jfkthame) 2012-06-12 03:34:58 PDT
Created attachment 632192 [details] [diff] [review]
minor optimization

A little micro-optimization.... it's potentially inefficient to constantly read aRanges.Length(); instead, we can keep track of the last range index in a local variable. We also don't need the initial Clear(), as ComputeRanges is always called with a freshly-constructed array.
Comment 2 Ed Morley [:emorley] 2012-06-26 09:24:45 PDT
https://hg.mozilla.org/mozilla-central/rev/064319559cb2

Note You need to log in before you can comment on or make changes to this bug.