Skip to content

Commit 4869b4c

Browse files
committed
---
yaml --- r: 243165 b: refs/heads/swift-5.0-branch c: 376753e h: refs/heads/master i: 243163: d631611
1 parent 68d48fa commit 4869b4c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b7c074342459a645779f106c42bf4
643643
refs/heads/master-llvm-swift5-transition: 8ace18c8953afb3d7d94cf04cacc0b51a7e5f1e3
644644
"refs/heads/revert-12883-disable_modelio_test_ios": a77ae373b809a0d8cb460cf3d1585d618510d242
645645
refs/heads/revert-13597-master: cccee1df039d072215f9bddc2cbc1e32a8d5d5ee
646-
refs/heads/swift-5.0-branch: 1848b3730074228613c76c48fe91585042b41789
646+
refs/heads/swift-5.0-branch: 376753e3a0e2e7e2471a171c416d6ac4552a60af
647647
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b32214f7e04339dfada623b6b76dbebfb41e4541
648648
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-24-a: 1eb0be506c0744c7eff0550a10240286046e181d
649649
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-25-a: f35a91502bad0065c83d8760407c23be7b899f48

branches/swift-5.0-branch/stdlib/public/core/Hasher.swift

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import SwiftShims
2020
// rdar://problem/38549901
2121
@usableFromInline
2222
internal protocol _HasherCore {
23-
init(seed: (UInt64, UInt64))
23+
init(seed: Hasher._Seed)
2424
mutating func compress(_ value: UInt64)
2525
mutating func finalize(tailAndByteCount: UInt64) -> UInt64
2626

@@ -33,7 +33,7 @@ internal protocol _HasherCore {
3333
/// This comes handy when type's _hash(into:) implementation needs to perform
3434
/// one-shot hashing for some of its components. (E.g., for commutative
3535
/// hashing.)
36-
func _generateSeed() -> (UInt64, UInt64)
36+
func _generateSeed() -> Hasher._Seed
3737
}
3838

3939
@inline(__always)
@@ -160,7 +160,7 @@ internal struct _BufferingHasher<Core: _HasherCore> {
160160
private var _core: Core
161161

162162
@inline(__always)
163-
internal init(seed: (UInt64, UInt64)) {
163+
internal init(seed: Hasher._Seed) {
164164
self._buffer = _HasherTailBuffer()
165165
self._core = Core(seed: seed)
166166
}
@@ -252,7 +252,7 @@ internal struct _BufferingHasher<Core: _HasherCore> {
252252
// Generate a seed value from the current state of this hasher.
253253
// FIXME(hasher): Remove
254254
@inline(__always)
255-
internal func _generateSeed() -> (UInt64, UInt64) {
255+
internal func _generateSeed() -> Hasher._Seed {
256256
return _core._generateSeed()
257257
}
258258

@@ -296,6 +296,9 @@ public struct Hasher {
296296
@usableFromInline
297297
internal typealias Core = _BufferingHasher<RawCore>
298298

299+
@usableFromInline
300+
internal typealias _Seed = (UInt64, UInt64)
301+
299302
internal var _core: Core
300303

301304
/// Creates a new hasher.
@@ -310,7 +313,7 @@ public struct Hasher {
310313
/// Initialize a new hasher using the specified seed value.
311314
@usableFromInline
312315
@_effects(releasenone)
313-
internal init(_seed seed: (UInt64, UInt64)) {
316+
internal init(_seed seed: _Seed) {
314317
self._core = Core(seed: seed)
315318
}
316319

@@ -331,7 +334,7 @@ public struct Hasher {
331334
/// The 128-bit hash seed used to initialize the hasher state. Initialized
332335
/// once during process startup.
333336
@inlinable
334-
internal static var _seed: (UInt64, UInt64) {
337+
internal static var _seed: _Seed {
335338
@inline(__always)
336339
get {
337340
// The seed itself is defined in C++ code so that it is initialized during
@@ -428,13 +431,13 @@ public struct Hasher {
428431
// FIXME(hasher): Remove
429432
@_effects(readnone)
430433
@usableFromInline
431-
internal func _generateSeed() -> (UInt64, UInt64) {
434+
internal func _generateSeed() -> Hasher._Seed {
432435
return _core._generateSeed()
433436
}
434437

435438
@_effects(readnone)
436439
@usableFromInline
437-
internal static func _hash(seed: (UInt64, UInt64), _ value: UInt64) -> Int {
440+
internal static func _hash(seed: _Seed, _ value: UInt64) -> Int {
438441
var core = RawCore(seed: seed)
439442
core.compress(value)
440443
let tbc = _HasherTailBuffer(tail: 0, byteCount: 8)
@@ -443,7 +446,7 @@ public struct Hasher {
443446

444447
@_effects(readnone)
445448
@usableFromInline
446-
internal static func _hash(seed: (UInt64, UInt64), _ value: UInt) -> Int {
449+
internal static func _hash(seed: _Seed, _ value: UInt) -> Int {
447450
var core = RawCore(seed: seed)
448451
#if arch(i386) || arch(arm)
449452
_sanityCheck(UInt.bitWidth < UInt64.bitWidth)
@@ -461,7 +464,7 @@ public struct Hasher {
461464
@_effects(readnone)
462465
@usableFromInline
463466
internal static func _hash(
464-
seed: (UInt64, UInt64),
467+
seed: _Seed,
465468
bytes value: UInt64,
466469
count: Int) -> Int {
467470
_sanityCheck(count >= 0 && count < 8)
@@ -473,7 +476,7 @@ public struct Hasher {
473476
@_effects(readnone)
474477
@usableFromInline
475478
internal static func _hash(
476-
seed: (UInt64, UInt64),
479+
seed: _Seed,
477480
bytes: UnsafeRawBufferPointer) -> Int {
478481
var core = Core(seed: seed)
479482
core.combine(bytes: bytes)

0 commit comments

Comments
 (0)