-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Description
I found a strange test in
| if ((candidate.events & event) != 0) { |
The whole function is:
private static Event find(int event)
{
for (Event candidate : Event.values()) {
if ((candidate.events & event) != 0) {
return candidate;
}
}
// never arrives here, but anyway...
return ALL;
}
}
What event is expected to be ? If it's a mask, as the test (candidate.events & event) != 0) implies, many values can fit. It's a single value, why bother with a binary and, an == will do the job ?
Metadata
Metadata
Assignees
Labels
No labels