mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
fix: wrong sha1 cmp
reported by staticcheck.
This commit is contained in:
parent
d464236573
commit
83b4206b15
@ -44,6 +44,7 @@ func TestBtree(t *testing.T) {
|
||||
assert2.NoError(t, bt.Close())
|
||||
|
||||
bt, err = Open(f)
|
||||
assert2.NoError(t, err)
|
||||
for i, tt := range tests {
|
||||
assert2.Equal(t, []byte(tt), bt.Get(sha[i]))
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ func cmp(a, b *byte) int64 {
|
||||
if *(*uint64)(pa) != *(*uint64)(pb) {
|
||||
return int64(*(*uint64)(pa) - *(*uint64)(pb))
|
||||
}
|
||||
return int64(*(*uint32)(unsafe.Add(pa, 8)) - *(*uint32)(unsafe.Add(pa, 8)))
|
||||
return int64(*(*uint32)(unsafe.Add(pa, 8)) - *(*uint32)(unsafe.Add(pb, 8)))
|
||||
}
|
||||
|
||||
func copysha1(dst *byte, src *byte) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user