Fix colors map initialization (#1200)

This commit is contained in:
gadotroee
2022-07-12 20:05:21 +03:00
committed by GitHub
parent 4b280ecd6d
commit a3c236ff0a
2 changed files with 11 additions and 3 deletions

View File

@@ -5,7 +5,6 @@ import (
"encoding/hex"
"fmt"
"reflect"
"strings"
"sync"
"time"
@@ -82,8 +81,7 @@ func GetGeneralStats() *GeneralStats {
func InitProtocolToColor(protocolMap map[string]*api.Protocol) {
for item, value := range protocolMap {
splitted := strings.SplitN(item, "/", 3)
protocolToColor[splitted[len(splitted)-1]] = value.BackgroundColor
protocolToColor[api.GetProtocolSummary(item).Abbreviation] = value.BackgroundColor
}
}