The call to `detectEvents` is already guarded by that check.

I'd put the `delete` of unusable events at the start of detectEvents to ensure it's covered by the check.