Skip to content

Commit

Permalink
server/storage/schema: prefer equal to compare for equality comparisons
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <sbatschelet@gmail.com>
  • Loading branch information
hexfusion committed May 17, 2023
1 parent b5e224d commit a708e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/storage/schema/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func DefaultIgnores(bucket, key []byte) bool {
// consistent index & term might be changed due to v2 internal sync, which
// is not controllable by the user.
// storage version might change after wal snapshot and is not controller by user.
return bytes.Compare(bucket, Meta.Name()) == 0 &&
(bytes.Compare(key, MetaTermKeyName) == 0 || bytes.Compare(key, MetaConsistentIndexKeyName) == 0 || bytes.Compare(key, MetaStorageVersionName) == 0)
return bytes.Equal(bucket, Meta.Name()) &&
(bytes.Equal(key, MetaTermKeyName) || bytes.Equal(key, MetaConsistentIndexKeyName) || bytes.Equal(key, MetaStorageVersionName))
}

func BackendMemberKey(id types.ID) []byte {
Expand Down

0 comments on commit a708e94

Please sign in to comment.