activation: simplify ListenersWithNames#498
Conversation
As map lookup returns nil if no key is found, and append will create a new slice if it's first argument is nil, we can greatly simplify the loop, as suggested in [1]. [1]: coreos#448 (comment) Reported-by: Paul Holzinger <[email protected]> Signed-off-by: Kir Kolyshkin <[email protected]>
|
@kolyshkin Did you only enabled rebase merges only and no longer the ones with merge commits? |
I had this option enabled in branch protection rules:
but I've disabled it now. While in other repos I've seen a few cases where a PR caused a bug which was not caught before merging because of another recently merged PR, such cases are rare and we catch them anyway after the merge (and can do a quick fix), so it's probably not worth the hassle here. |
As map lookup returns nil if no key is found, and append will create a new slice if it's first argument is nil, we can greatly simplify the loop, as suggested in 1.