refactor(tvix/eval): drop empty Word version cmp rule

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>
This commit is contained in:
sterni 2022-09-21 15:03:50 +02:00
parent 7ea249969a
commit 7bf1b4deea

View file

@ -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,