Mark enum entry names as name ids for incremental compilation purposes

Original commit: 697228eae0
This commit is contained in:
Alexander Udalov
2015-12-25 19:31:45 +03:00
parent 1227f8ad55
commit eafea73638
@@ -388,7 +388,7 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
open fun checkEquals(old: ProtoBuf.EnumEntry, new: ProtoBuf.EnumEntry): Boolean { open fun checkEquals(old: ProtoBuf.EnumEntry, new: ProtoBuf.EnumEntry): Boolean {
if (old.hasName() != new.hasName()) return false if (old.hasName() != new.hasName()) return false
if (old.hasName()) { if (old.hasName()) {
if (old.name != new.name) return false if (!checkStringEquals(old.name, new.name)) return false
} }
return true return true
@@ -1075,7 +1075,7 @@ public fun ProtoBuf.EnumEntry.hashCode(stringIndexes: (Int) -> Int, fqNameIndexe
var hashCode = 1 var hashCode = 1
if (hasName()) { if (hasName()) {
hashCode = 31 * hashCode + name hashCode = 31 * hashCode + stringIndexes(name)
} }
return hashCode return hashCode