Skip to content

Commit

Permalink
pep440: Optimise away one let environment for tail calls in release c…
Browse files Browse the repository at this point in the history
…omparison
  • Loading branch information
adisbladis committed Mar 2, 2024
1 parent ff31780 commit 8819dda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pep440.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ let

# Compare the release fields from the parsed version
compareRelease = offset: ra: rb:
let
x = elemAt ra offset;
y = elemAt rb offset;
in
if length ra == offset || length rb == offset then 0 else
(
let
x = elemAt ra offset;
y = elemAt rb offset;
in
if x == "*" || y == "*" then 0 # Wildcards are always considered equal
else
(
Expand Down

0 comments on commit 8819dda

Please sign in to comment.