mirror of
https://github.com/json-iterator/go.git
synced 2025-05-13 21:36:29 +02:00
fix issue on 32bit platform
This commit is contained in:
parent
17cbb770f0
commit
9670a03165
@ -43,7 +43,7 @@ func (iter *Iterator) readFieldHash() int32 {
|
|||||||
}
|
}
|
||||||
return int32(hash)
|
return int32(hash)
|
||||||
}
|
}
|
||||||
hash ^= int(b)
|
hash ^= int64(b)
|
||||||
hash *= 0x1000193
|
hash *= 0x1000193
|
||||||
}
|
}
|
||||||
if !iter.loadMore() {
|
if !iter.loadMore() {
|
||||||
@ -59,7 +59,7 @@ func (iter *Iterator) readFieldHash() int32 {
|
|||||||
func calcHash(str string) int32 {
|
func calcHash(str string) int32 {
|
||||||
hash := int64(0x811c9dc5)
|
hash := int64(0x811c9dc5)
|
||||||
for _, b := range str {
|
for _, b := range str {
|
||||||
hash ^= int(b)
|
hash ^= int64(b)
|
||||||
hash *= 0x1000193
|
hash *= 0x1000193
|
||||||
}
|
}
|
||||||
return int32(hash)
|
return int32(hash)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user