This commit is contained in:
Michael Schimmel
2026-02-21 15:18:29 +01:00
parent 9222fb5bc8
commit d645f36700
2 changed files with 8 additions and 10 deletions
+6 -8
View File
@@ -681,15 +681,13 @@ impl VM {
BoundKind::Tuple { elements } => {
// If the current value at offset is a Tuple or Record, we dive into it.
// Otherwise, we assume the sequence was already flattened (e.g. by Specializer).
if let Some(val) = values.get(*offset) {
if let Some(sub_values) = val.as_slice() {
*offset += 1;
let mut sub_offset = 0;
for el in elements {
self.unpack(el, sub_values, &mut sub_offset)?;
}
return Ok(());
if let Some(sub_values) = values.get(*offset).and_then(|v| v.as_slice()) {
*offset += 1;
let mut sub_offset = 0;
for el in elements {
self.unpack(el, sub_values, &mut sub_offset)?;
}
return Ok(());
}
for el in elements {
+2 -2
View File
@@ -72,7 +72,7 @@ pub fn run_benchmarks(update: bool) -> Vec<BenchmarkResult> {
for entry in entries.filter_map(|e| e.ok()) {
let path = entry.path();
if !path.extension().is_some_and(|ext| ext == "myc") {
if path.extension().is_none_or(|ext| ext != "myc") {
continue;
}
@@ -143,7 +143,7 @@ pub fn run_benchmarks(update: bool) -> Vec<BenchmarkResult> {
}
}
}
if results.last().map_or(false, |r| r.name == name) {
if results.last().is_some_and(|r| r.name == name) {
continue;
}
}