Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Sources/FoundationEssentials/Data/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,8 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
func hash(into hasher: inout Hasher) {
hasher.combine(count)

// At most, hash the first 80 bytes of this data.
let range = startIndex ..< Swift.min(startIndex + 80, endIndex)
storage.withUnsafeBytes(in: range) {
hasher.combine(bytes: $0)
self.withUnsafeBytes { bytes in
hasher.combine(bytes: bytes)
}
}
}
Expand Down Expand Up @@ -1325,10 +1323,8 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
func hash(into hasher: inout Hasher) {
hasher.combine(count)

// Hash at most the first 80 bytes of this data.
let range = startIndex ..< Swift.min(startIndex + 80, endIndex)
storage.withUnsafeBytes(in: range) {
hasher.combine(bytes: $0)
self.withUnsafeBytes { bytes in
hasher.combine(bytes: bytes)
}
}
}
Expand Down