diff --git a/pkg/document/json/rga_tree_split.go b/pkg/document/json/rga_tree_split.go index bc8ea7d1b..ed3cdb3ea 100644 --- a/pkg/document/json/rga_tree_split.go +++ b/pkg/document/json/rga_tree_split.go @@ -2,6 +2,7 @@ package json import ( "fmt" + "strconv" "strings" "github.com/yorkie-team/yorkie/internal/log" @@ -91,7 +92,7 @@ func (t *RGATreeSplitNodeID) hasSameCreatedAt(id *RGATreeSplitNodeID) bool { } func (t *RGATreeSplitNodeID) key() string { - return fmt.Sprintf("%s:%d", t.createdAt.Key(), t.offset) + return t.CreatedAt().Key() + ":" + strconv.FormatUint(uint64(t.offset), 10) } // RGATreeSplitNodePos is the position of the text inside the node. diff --git a/pkg/document/time/ticket.go b/pkg/document/time/ticket.go index c0a30669f..d05367b22 100644 --- a/pkg/document/time/ticket.go +++ b/pkg/document/time/ticket.go @@ -19,6 +19,7 @@ package time import ( "fmt" "math" + "strconv" ) const ( @@ -81,12 +82,17 @@ func (t *Ticket) AnnotatedString() string { // Key returns the key string for this Ticket. func (t *Ticket) Key() string { if t.actorID == nil { - return fmt.Sprintf("%d:%d:", t.lamport, t.delimiter) + return strconv.FormatUint(t.lamport, 10) + + ":" + + strconv.FormatUint(uint64(t.delimiter), 10) + + ":" } - return fmt.Sprintf( - "%d:%d:%s", t.lamport, t.delimiter, t.actorID.String(), - ) + return strconv.FormatUint(t.lamport, 10) + + ":" + + strconv.FormatUint(uint64(t.delimiter), 10) + + ":" + + t.actorID.String() } // Lamport returns the lamport value.