cosmetic: use map[_]struct{} for set semantics
Bug: NA Test: `m nothing` then view soong_metrics Change-Id: I2b3354de3259ffef9ae881d59ac844fb518074f2
This commit is contained in:
parent
9bc3a984d7
commit
09e0dd2ec9
1 changed files with 2 additions and 2 deletions
|
@ -98,12 +98,12 @@ func (h *EventHandler) CompletedEvents() []Event {
|
|||
h.scopeIds))
|
||||
}
|
||||
// Validate no two events have the same full id.
|
||||
ids := map[string]bool{}
|
||||
ids := map[string]struct{}{}
|
||||
for _, event := range h.completedEvents {
|
||||
if _, containsId := ids[event.Id]; containsId {
|
||||
panic(fmt.Errorf("Duplicate event registered: %s", event.Id))
|
||||
}
|
||||
ids[event.Id] = true
|
||||
ids[event.Id] = struct{}{}
|
||||
}
|
||||
return h.completedEvents
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue