@@ -30,24 +30,24 @@ trait Hashable {
30
30
31
31
protected def hashSeed : Int = getClass.hashCode
32
32
33
- private def finishHash (hashCode : Int , arity : Int ): Int =
33
+ protected final def finishHash (hashCode : Int , arity : Int ): Int =
34
34
avoidNotCached(hashing.finalizeHash(hashCode, arity))
35
35
36
36
final def identityHash = avoidNotCached(System .identityHashCode(this ))
37
37
38
- private def finishHash (seed : Int , arity : Int , tp : Type ): Int = {
38
+ protected def finishHash (seed : Int , arity : Int , tp : Type ): Int = {
39
39
val elemHash = tp.hash
40
40
if (elemHash == NotCached ) return NotCached
41
41
finishHash(hashing.mix(seed, elemHash), arity + 1 )
42
42
}
43
43
44
- private def finishHash (seed : Int , arity : Int , tp1 : Type , tp2 : Type ): Int = {
44
+ protected def finishHash (seed : Int , arity : Int , tp1 : Type , tp2 : Type ): Int = {
45
45
val elemHash = tp1.hash
46
46
if (elemHash == NotCached ) return NotCached
47
47
finishHash(hashing.mix(seed, elemHash), arity + 1 , tp2)
48
48
}
49
49
50
- private def finishHash (seed : Int , arity : Int , tps : List [Type ]): Int = {
50
+ protected def finishHash (seed : Int , arity : Int , tps : List [Type ]): Int = {
51
51
var h = seed
52
52
var xs = tps
53
53
var len = arity
@@ -61,7 +61,7 @@ trait Hashable {
61
61
finishHash(h, len)
62
62
}
63
63
64
- private def finishHash (seed : Int , arity : Int , tp : Type , tps : List [Type ]): Int = {
64
+ protected def finishHash (seed : Int , arity : Int , tp : Type , tps : List [Type ]): Int = {
65
65
val elemHash = tp.hash
66
66
if (elemHash == NotCached ) return NotCached
67
67
finishHash(hashing.mix(seed, elemHash), arity + 1 , tps)
@@ -88,6 +88,10 @@ trait Hashable {
88
88
protected final def doHash (x1 : Any , tp2 : Type , tps3 : List [Type ]): Int =
89
89
finishHash(hashing.mix(hashSeed, x1.hashCode), 1 , tp2, tps3)
90
90
91
+
92
+ protected final def doHash (x1 : Int , x2 : Int ): Int =
93
+ finishHash(hashing.mix(hashing.mix(hashSeed, x1), x2), 1 )
94
+
91
95
protected final def addDelta (hc : Int , delta : Int ) = avoidNotCached(hc + delta)
92
96
93
97
private def avoidNotCached (h : Int ) = if (h == NotCached ) NotCachedAlt else h
0 commit comments