by apo · 7y ago · 0 comments
For example, line 463 shows:
if !found {
// handle missing
} else {
// handle found
}
I would simplify this to: if found {
// handle found
} else {
// handle not found
}
Or even: if missing {
// handle missing
} else {
// handle not missing
}
The test-negative style is repeated throughout the file, but inconsistently. Sometimes the negative is tested in the if branch, sometimes it's tested in the else branch. Why?