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

Allow renaming a variable twice as it might happen in some cases. #4967

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Jan 31, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-lowering/src/optimizations/cancel_ops.rs line 41 at r1 (raw file):

    // Remove no-longer needed statements.
    stmts_to_remove.sort_by_key(|(block_id, stmt_id)| (block_id.0, *stmt_id));
    for (block_id, stmt_id) in stmts_to_remove.into_iter().rev().dedup() {

how do you know the problematic ones would be consecutive?
doc how you know it, and why these might exist.

Code quote:

    for (block_id, stmt_id) in stmts_to_remove.into_iter().rev().dedup() {

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-lowering/src/optimizations/cancel_ops.rs line 41 at r1 (raw file):

Previously, orizi wrote…

how do you know the problematic ones would be consecutive?
doc how you know it, and why these might exist.

because of the sorting.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-lowering/src/optimizations/cancel_ops.rs line 41 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

because of the sorting.

oh - right - but still doc the need for dedup.

Copy link
Contributor Author

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/optimizations/cancel_ops.rs line 41 at r1 (raw file):

Previously, orizi wrote…

oh - right - but still doc the need for dedup.

Done.
I couldn't put the .dedup() before the .rev().

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit 133ee0e Jan 31, 2024
42 checks passed
@orizi orizi deleted the ilya/rename_twice branch February 4, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants