-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Import the new inline Data implementation and DataProtocol from the overlay #1813
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
Import the new inline Data implementation and DataProtocol from the overlay #1813
Conversation
@swift-ci please test |
Foundation/DataProtocol.swift
Outdated
} | ||
|
||
public func lastRange<D: DataProtocol>(of data: D) -> Range<Index>? { | ||
return self.firstRange(of: data, in: self.startIndex ..< self.endIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be lastRange
.
See the 5.0 cherry-pick at swiftlang/swift#21292. We should sync that updated version to the overlay on master, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea we definitely shouldn't have master be different for Data and swift-5.0
Foundation/Data.swift
Outdated
count = range.upperBound | ||
} | ||
Swift.withUnsafeMutableBytes(of: &bytes) { rawBuffer in | ||
bzero(rawBuffer.baseAddress?.advanced(by: range.lowerBound), range.upperBound - range.lowerBound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this was replaced with memset. bzero isn't portable.
…he swift version in the xcode projects and correct some failures in TestURL by updating to 4.2
@swift-ci please test |
1 similar comment
@swift-ci please test |
This is out of date and supplanted by the other merge I landed. |
#1834 was the one that landed |
This brings Data in sync with the overlay changes for the new inline revamp.