@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

TransactionEditor: micro-optimize the "creation finder"

Summary:
The foreach starting at old line 1305-1311 was designed to look for a specific transaction type.

When we have found that, let's stop that loop, so, we save some CPU cycles.

Test Plan:
Note that getTransactionType() has not side-effects.

Test some applications - like Pholio - that use the TransactionEditor:

- Create a new Pholio and Save
- Save it again without changes.
- Save it again with changes.

Everything still working normally.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25627

+1
+1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1307 1307 foreach ($xactions as $xaction) { 1308 1308 if ($xaction->getTransactionType() == $create_type) { 1309 1309 $mark_as_create = true; 1310 + break; 1310 1311 } 1311 1312 } 1312 1313