Apply some guy's law about logic operation reordering

This commit is contained in:
Melody Becker 2025-04-24 15:58:32 +02:00
parent 695b48ae91
commit 99b00887a8
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI

View file

@ -65,7 +65,7 @@ func CompareMap[K, V comparable](a, b map[K]V) bool {
// Then compare key-value pairs
for k, v := range a {
val, ok := b[k]
if !(ok && val == v) {
if !ok || val != v {
return false
}
}