Fix performance regression in NI by fixing totally incorrect hashCode
The actual problem was introduced in4f1e85b468, note how `hashCode` is implemented: ``` var currentHashCode = cachedHashCode if (currentHashCode == 0) return currentHashCode ... ``` It's a silly bug, there should be check `if (currentHashCode != 0) ...` because `0` is used a marker for "uncomputed value". Now, in the commit0219b86d06I added map with `KotlinType` as a key and because of constant `hash` for `KotlinType`, we basically got `List` instead of `Map`, which caused this performance regression #KT-34063 Fixed
This commit is contained in:
@@ -19,7 +19,7 @@ fun case_1(x: Any) {
|
||||
if (x is Interface1) {
|
||||
if (x is Interface2) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & Interface2 & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & kotlin.Any"), DEBUG_INFO_SMARTCAST!>x<!>.itest()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & kotlin.Any"), DEBUG_INFO_SMARTCAST!>x<!>.itest()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & kotlin.Any"), DEBUG_INFO_SMARTCAST!>x<!>.itest1()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & kotlin.Any"), DEBUG_INFO_SMARTCAST!>x<!>.itest2()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user