mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 08:46:56 +08:00
support multi transaction
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package list
|
||||
|
||||
import "github.com/hdt3213/godis/datastruct/utils"
|
||||
import "github.com/hdt3213/godis/lib/utils"
|
||||
|
||||
// LinkedList is doubly linked list
|
||||
type LinkedList struct {
|
||||
|
@@ -1,30 +0,0 @@
|
||||
package utils
|
||||
|
||||
// Equals check whether the given value is equal
|
||||
func Equals(a interface{}, b interface{}) bool {
|
||||
sliceA, okA := a.([]byte)
|
||||
sliceB, okB := b.([]byte)
|
||||
if okA && okB {
|
||||
return BytesEquals(sliceA, sliceB)
|
||||
}
|
||||
return a == b
|
||||
}
|
||||
|
||||
// BytesEquals check whether the given bytes is equal
|
||||
func BytesEquals(a []byte, b []byte) bool {
|
||||
if (a == nil && b != nil) || (a != nil && b == nil) {
|
||||
return false
|
||||
}
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
size := len(a)
|
||||
for i := 0; i < size; i++ {
|
||||
av := a[i]
|
||||
bv := b[i]
|
||||
if av != bv {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user