Improve JS performance by storing length before comparing to it in loops#80515
Merged
bors merged 2 commits intorust-lang:masterfrom Jan 16, 2021
Merged
Improve JS performance by storing length before comparing to it in loops#80515bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
Some changes occurred in HTML/CSS/JS. |
Merged
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 4, 2021
More js cleanup Part of rust-lang#79052 (Same kind as rust-lang#80515). This one is about some small fixes: * Replacing some loops with `onEachLazy`. * Removing unused function arguments. * Turn `buildHelperPopup` into a variable so it can be "replaced" once the function has been called once so it's not called again. r? `@jyn514`
Collaborator
|
☔ The latest upstream changes (presumably #80554) made this pull request unmergeable. Please resolve the merge conflicts. |
8819166 to
9f21834
Compare
jyn514
reviewed
Jan 7, 2021
Member
jyn514
left a comment
There was a problem hiding this comment.
I think the new code isn't any easier to read, and it creates a lot of churn.
9f21834 to
a59b765
Compare
Member
Author
|
Updated! |
Nemo157
reviewed
Jan 15, 2021
a59b765 to
e727600
Compare
Member
Author
|
@Nemo157 Updated! |
Nemo157
approved these changes
Jan 15, 2021
Contributor
Nemo157
left a comment
There was a problem hiding this comment.
The rest of the changes all look correct 👍
| break; | ||
| } | ||
| for (x = 0; x < arrays.length && ret.length < MAX_RESULTS; ++x) { | ||
| for (x = 0; x < arrays_len && ret.length < MAX_RESULTS; ++x) { |
Contributor
There was a problem hiding this comment.
This is using the non-lexical variable from line 1700, right? JS is fun 😭.
Member
Author
There was a problem hiding this comment.
Yes. It's a syntax nightmare. ^^'
Member
Author
Collaborator
|
📌 Commit e727600 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 16, 2021
…laumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#77693 (Add test for rust-lang#59352) - rust-lang#80515 (Improve JS performance by storing length before comparing to it in loops) - rust-lang#81030 (Update mdbook) - rust-lang#81033 (Remove useless `clean::Variant` struct) - rust-lang#81049 (inline: Round word-size cost estimates up) - rust-lang#81054 (Drop a few unneeded borrows) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #79052 is quite complicated to review, I suggested to split into smaller parts. This first part is mostly about saving the array length into a variable (I tried to not change anything else as much as possible 😃 ).
r? @jyn514