Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment in cancel_ops.rs #5781

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/cairo-lang-lowering/src/optimizations/cancel_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ pub struct CancelOpsContext<'a> {
/// Keeps track of all the aliases created by the renaming.
aliases: UnorderedHashMap<VariableId, Vec<VariableId>>,

/// Statements that can be be removed.
/// Statements that can be removed.
stmts_to_remove: Vec<StatementLocation>,
}

/// Similar to `mapping.get(var).or_default()` but but works for types that don't implement Default.
/// Similar to `mapping.get(var).or_default()` but works for types that don't implement Default.
fn get_entry_as_slice<'a, T>(
mapping: &'a UnorderedHashMap<VariableId, Vec<T>>,
var: &VariableId,
Expand Down Expand Up @@ -179,7 +179,7 @@ impl<'a> CancelOpsContext<'a> {
if !(can_remove_struct_destructure
|| self.lowered.variables[stmt.input.var_id].copyable.is_ok())
{
// We can't remove any of of the construct statements.
// We can't remove any of the construct statements.
self.stmts_to_remove.truncate(self.stmts_to_remove.len() - constructs.len());
return false;
}
Expand Down