bytes.Equal should be faster than bytes.Compare.

This commit is contained in:
Andrey Smirnov
2014-10-06 15:17:25 +04:00
parent d541b4f137
commit e4b9e974d2

View File

@@ -101,7 +101,7 @@ func (l *levelDB) Put(key []byte, value []byte) error {
return err
}
} else {
if bytes.Compare(old, value) == 0 {
if bytes.Equal(old, value) {
return nil
}
}