Page MenuHomekolab.org

Avoid extra query if we know no entry exists
ClosedPublic

Authored by mollekopf on Aug 27 2021, 12:48 PM.

Details

Reviewers
machniak
Group Reviewers
Restricted Project
Commits
rK5ae2e7a89350: Avoid extra query if we know no entry exists

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mollekopf requested review of this revision.Aug 27 2021, 12:48 PM
mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Aug 27 2021, 12:48 PM
machniak requested changes to this revision.Aug 27 2021, 12:51 PM
machniak added a subscriber: machniak.

Please, also fix this:

FILE: ...home/alec/repos/kolab/src/tests/Feature/Stories/GreylistTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 434 | ERROR | [x] The closing brace for the class must go on the
     |       |     next line after the body
src/app/Policy/Greylist/Request.php
190

I usually would write this as if (!$noEntry && ($connect = $this->findConnectsCollection()->first())) { even if the brackets aren't required.

This revision now requires changes to proceed.Aug 27 2021, 12:51 PM
This revision was not accepted when it landed; it landed in state Needs Revision.Aug 27 2021, 1:05 PM
This revision was automatically updated to reflect the committed changes.