From 7bf1b4deea0be5fcb183b7b39165185c2e9fc521 Mon Sep 17 00:00:00 2001 From: sterni Date: Wed, 21 Sep 2022 15:03:50 +0200 Subject: refactor(tvix/eval): drop empty Word version cmp rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tvix/eval/src/builtins/versions.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tvix/eval/src/builtins') 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, -- cgit 1.4.1