Bug 1385369 - Reserve 1 space in Selection::mRanges; r=qdot

Most selections on the Web end up with one Range inside them.
By reserving the space for this one range inline, we can avoid the
allocator pressure in a lot of hot code when manipulating the
Selection object.
This commit is contained in:
Ehsan Akhgari 2017-07-28 13:24:51 -04:00
Родитель 540442244f
Коммит 8e7275d330
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -437,7 +437,7 @@ private:
// proves to be a performance concern, then an interval tree may be a
// possible solution, allowing the calculation of the overlap interval in
// O(log n) time, though this would require rebalancing and other overhead.
nsTArray<RangeData> mRanges;
AutoTArray<RangeData, 1> mRanges;
RefPtr<nsRange> mAnchorFocusRange;
RefPtr<nsFrameSelection> mFrameSelection;