Skip to content

extract map copying logic to a separate function #1586

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

Merged
merged 2 commits into from
Jan 8, 2015
Merged

extract map copying logic to a separate function #1586

merged 2 commits into from
Jan 8, 2015

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Jan 2, 2015

in v8 presence of for-in over objects being used as dictionaries prevents functions from being optimized (https://github.com/petkaantonov/bluebird/wiki/Optimization-killers). objectTypeRelatedTo is a hot path so it is highly desirable for this function to be optimized

for (var p in maybeCache) {
destinationCache[p] = maybeCache[p];
}
copyMap(maybeCache, destinationCache);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use named parameter comments to specify whichis the source, and which is the destination? Thanks!

@DanielRosenwasser
Copy link
Member

👍

1 similar comment
@ahejlsberg
Copy link
Member

👍

vladima added a commit that referenced this pull request Jan 8, 2015
extract map copying logic to a separate function
@vladima vladima merged commit 5562810 into master Jan 8, 2015
@vladima vladima deleted the copymap branch January 8, 2015 22:22
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants