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

HTMLImageElement::handle_event should use a for loop #15885

Closed
Ms2ger opened this issue Mar 9, 2017 · 5 comments
Closed

HTMLImageElement::handle_event should use a for loop #15885

Ms2ger opened this issue Mar 9, 2017 · 5 comments

Comments

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Mar 9, 2017

Code: components/script/dom/htmlimageelement.rs

It uses

           let mut index = 0;
           while index < elements.len() {
               // Use elements[index]
               index += 1;
           }

I don't see any reason it can't use for element in elements {}

Doesn't need a test; if it compiles, that's good enough.

@highfive
Copy link

@highfive highfive commented Mar 9, 2017

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@hgallagher1993
Copy link
Contributor

@hgallagher1993 hgallagher1993 commented Mar 9, 2017

I'll take this @highfive: assign me

@highfive
Copy link

@highfive highfive commented Mar 9, 2017

Hey @hgallagher1993! Thanks for your interest in working on this issue. It's now assigned to you!

@highfive highfive added the C-assigned label Mar 9, 2017
@snehasi
Copy link
Contributor

@snehasi snehasi commented Mar 9, 2017

@highfive assign me

@highfive
Copy link

@highfive highfive commented Mar 9, 2017

It looks like this has already been assigned to someone. I'll leave the decision to a core contributor.

bors-servo added a commit that referenced this issue Mar 10, 2017
Change while loop in HTMLImageElement::handle_event to for loop

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15885

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because @Ms2ger said none were needed

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15892)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.