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

[Code Fix] Unsafe Whle Loop #12

Closed
e6654321 opened this issue Jul 6, 2024 · 4 comments
Closed

[Code Fix] Unsafe Whle Loop #12

e6654321 opened this issue Jul 6, 2024 · 4 comments

Comments

@e6654321
Copy link

e6654321 commented Jul 6, 2024

#10 - Unsafe loop condition which could lead to an error upon the Compute Phase

@nns2009
Copy link

nns2009 commented Jul 10, 2024

But loop already has:

ifnot (cs.slice_refs()) {
  return ();
}

@e6654321
Copy link
Author

But loop already has:


ifnot (cs.slice_refs()) {

  return ();

}

Yes I'm aware. The anti pattern I'm referring to is on doing 'true' inside the while loop. Putting loops without conditions should be avoided.

@nns2009
Copy link

nns2009 commented Jul 13, 2024

Putting loops without conditions should be avoided

Why? Your suggestion just spends extra gas for the extra check, but doesn't affect logic in any way

@tolya-yanot
Copy link
Member

no problems found

@tolya-yanot tolya-yanot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
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

No branches or pull requests

3 participants