Generate equals()/hashCode(): Fix hashCode() implementation
#KT-11638 Fixed
This commit is contained in:
+2
-2
@@ -20,8 +20,8 @@ class A(val n: Int?, val s: String) {
|
||||
|
||||
override fun hashCode(): Int{
|
||||
var result = n ?: 0
|
||||
result += 31 * result + s.hashCode()
|
||||
result += 31 * result + (f?.hashCode() ?: 0)
|
||||
result = 31 * result + s.hashCode()
|
||||
result = 31 * result + (f?.hashCode() ?: 0)
|
||||
return result
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user