Review 11.5 Merged

72980[BUGFIX] Avoid evaluating all regexp redirects if early match found

Christian Kuhn CR +2 V +2 Easy +34 −16 updated 01/14/22, 18:53

Commit message

ext:redirects middleware collected all possible redirects,
thus evaluating all regexp redirects to find possible matches.
These collected possible redirects are looped afterwards and
checked, if redirect is active, meaning not having any start
and/or end time constraints or if time constrain is in the active
timespan, returning the first feasible redirect. However this
evaluated all regexp redirects, even if flat redirects with query
arguments, flat redirects without query arguments or a regexp
redirect is found.

This patch changes this behaviour and checks early for found subset
of possible redirects to avoid evaluating at least all regexp
redirects even if an early one would be used anyway.

This is a minor performance improvement in case an early redirect
can be matched, without any effect if no match could be found.

Further performance improvements may be possible but should be done
in dedicated follow up patches.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1