@@ -688,24 +688,26 @@ func ParseGres(gres string) *protos.DeviceMap {
688
688
}
689
689
690
690
func GetDeviceMapStr (resourceView * protos.ResourceView ) string {
691
- if resourceView .DeviceMap == nil ||
692
- resourceView .DeviceMap .NameTypeMap == nil ||
693
- len (resourceView .DeviceMap .NameTypeMap ) == 0 {
691
+ if resourceView .DeviceMap == nil || resourceView .DeviceMap .NameTypeMap == nil || len (resourceView .DeviceMap .NameTypeMap ) == 0 {
694
692
return "None"
695
693
}
696
694
697
695
var result strings.Builder
698
- isFirstDevice := true
696
+ isFirstDevice := true
699
697
700
698
for deviceName , typeCountMap := range resourceView .DeviceMap .NameTypeMap {
701
699
if ! isFirstDevice {
702
700
result .WriteString ("; " )
703
701
} else {
704
702
isFirstDevice = false
705
703
}
706
- result .WriteString (fmt .Sprintf ("%s:" , deviceName ))
704
+
705
+ result .WriteString (deviceName )
706
+ result .WriteString (":" )
707
+
707
708
if typeCountMap .Total > 0 {
708
- result .WriteString (fmt .Sprintf ("untyped:%d" , typeCountMap .Total ))
709
+ result .WriteString ("untyped:" )
710
+ result .WriteString (strconv .FormatUint (typeCountMap .Total , 10 ))
709
711
}
710
712
711
713
isFirstType := typeCountMap .Total == 0
@@ -716,7 +718,9 @@ func GetDeviceMapStr(resourceView *protos.ResourceView) string {
716
718
isFirstType = false
717
719
}
718
720
719
- result .WriteString (fmt .Sprintf ("%s:%d" , typeName , count ))
721
+ result .WriteString (typeName )
722
+ result .WriteString (":" )
723
+ result .WriteString (strconv .FormatUint (count , 10 ))
720
724
}
721
725
}
722
726
0 commit comments