Skip to content

Commit ab950ea

Browse files
committed
use string builder for serialisation
1 parent f61f975 commit ab950ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

channels/set.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ type ID struct {
3737
}
3838

3939
func (c ID) String() string {
40-
return strconv.FormatUint(uint64(c.CollectionID), 10) + "." + base.UserDataPrefix + c.Name + base.UserDataSuffix
40+
var sb strings.Builder
41+
sb.WriteString(strconv.FormatUint(uint64(c.CollectionID), 10))
42+
sb.WriteByte('.')
43+
sb.WriteString(base.UserDataPrefix)
44+
sb.WriteString(c.Name)
45+
sb.WriteString(base.UserDataSuffix)
46+
return sb.String()
4147
}
4248

4349
// NewID returns a new ChannelID

0 commit comments

Comments
 (0)