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:
parent
444c634b6c
commit
ba9b4f5b66
1 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue