1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Optimize SQL queries in differential.getdiff

Test Plan:
Verified that the method retuns the same output.
Verified the number of SQL queries.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2764
This commit is contained in:
vrana 2012-06-15 14:56:03 -07:00
parent 444c634b6c
commit ba9b4f5b66

View file

@ -70,10 +70,11 @@ final class ConduitAPI_differential_getdiff_Method extends ConduitAPIMethod {
throw new ConduitException('ERR_BAD_DIFF');
}
$diff->attachChangesets($diff->loadChangesets());
// TODO: We could batch this to improve performance.
$diff->attachChangesets(
$diff->loadRelatives(new DifferentialChangeset(), 'diffID'));
foreach ($diff->getChangesets() as $changeset) {
$changeset->attachHunks($changeset->loadHunks());
$changeset->attachHunks(
$changeset->loadRelatives(new DifferentialHunk(), 'changesetID'));
}
$basic_dict = $diff->getDiffDict();