From 7e88ad64daf73c8fb12d017d3405771e4b49bb19 Mon Sep 17 00:00:00 2001 From: jussisaurio Date: Thu, 1 Aug 2024 17:51:54 +0300 Subject: [PATCH] Rename and comment --- core/translate/where_clause.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/translate/where_clause.rs b/core/translate/where_clause.rs index 07163e5c6..d52b44073 100644 --- a/core/translate/where_clause.rs +++ b/core/translate/where_clause.rs @@ -223,9 +223,10 @@ pub fn translate_processed_where<'a>( loops: &[LoopInfo], current_loop: &'a LoopInfo, where_c: &'a ProcessedWhereClause, - skip_entire_table_label: BranchOffset, + skip_entire_loop_label: BranchOffset, cursor_hint: Option, ) -> Result<()> { + // If any of the terms are always false, we can skip the entire loop. for t in where_c.terms.iter().filter(|t| { select.src_tables[t.evaluate_at_loop(select)].identifier == current_loop.identifier }) { @@ -233,9 +234,9 @@ pub fn translate_processed_where<'a>( if e.is_always_false().unwrap_or(false) { program.emit_insn_with_label_dependency( Insn::Goto { - target_pc: skip_entire_table_label, + target_pc: skip_entire_loop_label, }, - skip_entire_table_label, + skip_entire_loop_label, ); return Ok(()); }