about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-09-19T08·59+0200
committersterni <sternenseemann@systemli.org>2022-09-19T09·58+0000
commit4bf38df09c6a39ec9d33b3fc578c901227150c64 (patch)
tree6a241ccfc4d6b8ea8a641edfd78b422fbb051f59
parentb79e248959cbccd6b387a52750de54b388a9a2c3 (diff)
fix(tvix/eval): fix flipped sign in builtins.compareVersions r/4919
Change-Id: I42fc0dc633fbd525eaa35689a41ec3717f4352a2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6690
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/src/builtins/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 10ec6c89f946..a5ca2114e1f7 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -109,9 +109,9 @@ fn pure_builtins() -> Vec<Builtin> {
             let s2 = VersionPartsIter::new(s2.as_str());
 
             match s1.cmp(s2) {
-                std::cmp::Ordering::Less => Ok(Value::Integer(1)),
+                std::cmp::Ordering::Less => Ok(Value::Integer(-1)),
                 std::cmp::Ordering::Equal => Ok(Value::Integer(0)),
-                std::cmp::Ordering::Greater => Ok(Value::Integer(-1)),
+                std::cmp::Ordering::Greater => Ok(Value::Integer(1)),
             }
         }),
         Builtin::new("div", &[true, true], |mut args, _| {