refactor(baseapp): when the capacity is determined, avoid memory copying (#20200)

This commit is contained in:
Qt 2024-04-28 13:26:56 +08:00 committed by GitHub
parent a6871c74c3
commit 6828584424
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -462,7 +462,7 @@ func (app *BaseApp) setTrace(trace bool) {
}
func (app *BaseApp) setIndexEvents(ie []string) {
app.indexEvents = make(map[string]struct{})
app.indexEvents = make(map[string]struct{}, len(ie))
for _, e := range ie {
app.indexEvents[e] = struct{}{}