Skip to content

[stdlib] a minor optimization #39824

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 1 commit into from
Oct 21, 2021

Conversation

glessard
Copy link
Contributor

We have already done the hard work of unwrapping the optional pointers that represent the beginning and end of the buffer. Calling self.count does that all over again. Use the distance between the unwrapped pointers instead.

No SR.

This is an optimization for relatively recent code (see #38828).

We have already done the hard work of unwrapping the optionals
that represent the first and last pointer, and calling `self.count` does it all over again. Use the distance between the unwrapped pointers instead.
@glessard
Copy link
Contributor Author

@swift-ci please smoke test

@glessard glessard requested a review from lorentey October 20, 2021 00:12
Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@glessard glessard merged commit 8eea642 into swiftlang:main Oct 21, 2021
@glessard glessard deleted the urbp-copycontents-optimization branch October 21, 2021 17:40
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

Successfully merging this pull request may close these issues.

2 participants