Bug 1306249 - Optimize SumChildTimes by only iterating children, r=jonco

--HG--
extra : rebase_source : 250b8992977a5c5a969c510d812694da8c0ade4e
This commit is contained in:
Steve Fink 2016-09-30 13:16:52 -07:00
Родитель 2fbae55abc
Коммит c389f7e9d7
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -328,7 +328,8 @@ SumChildTimes(size_t phaseSlot, Phase phase, const Statistics::PhaseTimeTable ph
{
// Sum the contributions from single-parented children.
int64_t total = 0;
for (unsigned i = 0; i < PHASE_LIMIT; i++) {
size_t depth = phaseExtra[phase].depth;
for (unsigned i = phase + 1; i < PHASE_LIMIT && phaseExtra[i].depth > depth; i++) {
if (phases[i].parent == phase)
total += phaseTimes[phaseSlot][i];
}