about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-09-21T13·03+0200
committersterni <sternenseemann@systemli.org>2022-09-21T14·23+0000
commit7bf1b4deea0be5fcb183b7b39165185c2e9fc521 (patch)
tree65e3f8896dea35cdc117cad81915953c10e1c301
parent7ea249969a0c76af4a9375cb61ad7e9e6ea816f4 (diff)
refactor(tvix/eval): drop empty Word version cmp rule r/4953
This was derived from

    else if (c1 == "" && n2) return true; // true implies c1 < n2

However, this has no effect since Word always looses out against Number
anyways and the `pre` rules are also unaffected by this change – since
this only affects comparison of an empty Word part with a Number.

Change-Id: Ia04e42ac726352b688c87674b0fdb355f06edbcb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6722
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
-rw-r--r--tvix/eval/src/builtins/versions.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/tvix/eval/src/builtins/versions.rs b/tvix/eval/src/builtins/versions.rs
index e149cc4dba37..9da7b52ab15c 100644
--- a/tvix/eval/src/builtins/versions.rs
+++ b/tvix/eval/src/builtins/versions.rs
@@ -28,10 +28,6 @@ impl Ord for VersionPart<'_> {
                 n1.cmp(&n2)
             }
 
-            // empty Word always looses
-            (VersionPart::Word(""), VersionPart::Number(_)) => Ordering::Less,
-            (VersionPart::Number(_), VersionPart::Word("")) => Ordering::Greater,
-
             // `pre` looses unless the other part is also a `pre`
             (VersionPart::Word("pre"), VersionPart::Word("pre")) => Ordering::Equal,
             (VersionPart::Word("pre"), _) => Ordering::Less,