Skip to content

Commit

Permalink
bug fix: use StreamId pointer to enable MarshalText
Browse files Browse the repository at this point in the history
  • Loading branch information
HDT3213 committed Apr 16, 2023
1 parent 82412cd commit 386a9db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ Tested on MacBook Pro (16-inch, 2019) 2.6 GHz 6cores Intel Core i7, using a 1.3

|usage|elapsed|speed|
|:-:|:-:|:-:|
|ToJson|144.11s|9.23MB/s|
|ToJson|74.12s|17.96MB/s|
|Memory|18.585s|71.62MB/s|
|AOF|104.77s|12.76MB/s|
|Top10|14.8s|89.95MB/s|
|FlameGraph|49.38s|26.96MB/s|
|FlameGraph|21.83s|60.98MB/s|
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ func main() {

|usage|elapsed|speed|
|:-:|:-:|:-:|
|ToJson|144.11s|9.23MB/s|
|ToJson|74.12s|17.96MB/s|
|Memory|18.585s|71.62MB/s|
|AOF|104.77s|12.76MB/s|
|Top10|14.8s|89.95MB/s|
|FlameGraph|49.38s|26.96MB/s|
|FlameGraph|21.83s|60.98MB/s|
2 changes: 1 addition & 1 deletion core/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (dec *Decoder) readStreamEntryContent(buf []byte, cursor *int, firstId *mod
if err != nil {
return nil, fmt.Errorf("read stream item id seq failed: %v", err)
}
msgId := model.StreamId{
msgId := &model.StreamId{
Ms: ms + firstId.Ms,
Sequence: seq + firstId.Sequence,
}
Expand Down
2 changes: 1 addition & 1 deletion model/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type StreamEntry struct {

// StreamMessage is a message item in stream
type StreamMessage struct {
Id StreamId `json:"id"`
Id *StreamId `json:"id"`
Fields map[string]string `json:"fields"`
Deleted bool `json:"deleted"`
}
Expand Down

0 comments on commit 386a9db

Please sign in to comment.