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

Removes redundant buffer zeroing in JSONSerialization #2703

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

valeriyvan
Copy link
Contributor

No description provided.

@spevans
Copy link
Collaborator

spevans commented Feb 27, 2020

@swift-ci test

} else {
data.append(&buffer, count: bytesRead)
let buffer = try [UInt8].init(unsafeUninitializedCapacity: 1024) { buf, initializedCount in
let bytesRead = stream.read(buf.baseAddress!, maxLength: 1024)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could the second 1024 be changed to buf.count just to remove the duplicated constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@valeriyvan valeriyvan requested a review from spevans March 6, 2020 15:38
@spevans
Copy link
Collaborator

spevans commented Mar 6, 2020

@swift-ci test linux

@spevans spevans merged commit f98195d into apple:master Mar 6, 2020
@valeriyvan valeriyvan deleted the RedundantZeroingJSONSerialization branch March 6, 2020 20:11
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.

None yet

2 participants