Repository navigation
fix: parse method mutating its input - #231
Merged
Merged
Conversation
Contributor
Author
|
/cc @lholmquist @lance |
matejvasek
force-pushed
the
fix-struct-parse
branch
from
June 24, 2020 15:57
475a93b to
ff925ef
Compare
lholmquist
reviewed
Jun 24, 2020
| }; | ||
|
|
||
|
|
||
| const unprocessed = new Set(Object.keys(incoming)); |
Contributor
There was a problem hiding this comment.
is Set necessary here. Can't we assume that the keys in the object are unique already?
Contributor
Author
There was a problem hiding this comment.
I think they should be unique. The thing is: If I understand it correctly Object.keys(incoming) returns an array and deletion from an array is more complicated than just delete() which is offered by a Set object.
lance
reviewed
Jun 24, 2020
| }; | ||
|
|
||
|
|
||
| const unprocessed = new Set(Object.keys(incoming)); |
Member
There was a problem hiding this comment.
I think the most efficient would be using the spread operator like this.
Suggested change
| const unprocessed = new Set(Object.keys(incoming)); | |
| const unprocessed = { ...incoming }; |
Signed-off-by: Matej Vasek <mvasek@redhat.com>
matejvasek
force-pushed
the
fix-struct-parse
branch
from
June 24, 2020 19:27
ff925ef to
4aa2cda
Compare
Contributor
Author
|
@lance I force pushed it. There is now only one line changed: |
Closed
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.
fixes: #230