Skip to content

Commit fec7bc0

Browse files
committed
Revert "add"
This reverts commit a012215.
1 parent a012215 commit fec7bc0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

enum.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ type enumMembers struct {
2828
}
2929

3030
func (em *enumMembers) add(name string, val constantValue) {
31+
em.Names = append(em.Names, name)
32+
3133
if em.NameToValue == nil {
3234
em.NameToValue = make(map[string]constantValue)
3335
}
36+
em.NameToValue[name] = val
37+
3438
if em.ValueToNames == nil {
3539
em.ValueToNames = make(map[constantValue][]string)
3640
}
37-
38-
em.Names = append(em.Names, name)
39-
em.NameToValue[name] = val
4041
em.ValueToNames[val] = append(em.ValueToNames[val], name)
4142
}
4243

0 commit comments

Comments
 (0)