mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>
This commit is contained in:
@@ -209,7 +209,7 @@ func TestHeap_Get(t *testing.T) {
|
||||
}
|
||||
// Get non-existing object.
|
||||
_, exists, err = h.Get(mkHeapObj("non-existing", 0))
|
||||
if err != nil || exists == true {
|
||||
if err != nil || exists {
|
||||
t.Fatalf("didn't expect to get any object")
|
||||
}
|
||||
}
|
||||
@@ -223,12 +223,12 @@ func TestHeap_GetByKey(t *testing.T) {
|
||||
h.Add(mkHeapObj("baz", 11))
|
||||
|
||||
obj, exists, err := h.GetByKey("baz")
|
||||
if err != nil || exists == false || obj.(testHeapObject).val != 11 {
|
||||
if err != nil || !exists || obj.(testHeapObject).val != 11 {
|
||||
t.Fatalf("unexpected error in getting element")
|
||||
}
|
||||
// Get non-existing object.
|
||||
_, exists, err = h.GetByKey("non-existing")
|
||||
if err != nil || exists == true {
|
||||
if err != nil || exists {
|
||||
t.Fatalf("didn't expect to get any object")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user