mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
By moving a should_redirect_with_slash call out of an if block, commit9390da7fb6negated the performance fix of commit434d309ef6(#24720). Meanwhile, the logging issue #26293 that it targeted was subsequently fixed more fully by commit40b69607c7(#26504), so it is no longer needed. This effectively reverts it. This speeds up successful requests not ending with / when APPEND_SLASH is enabled (the default, and still useful in projects with a mix of URLs with and without trailing /). The amount of speedup varies from about 5% in a typical project to nearly 50% on a benchmark with many routes. Signed-off-by: Anders Kaseorg <andersk@mit.edu>