Skip to content

Commit

Permalink
Avoid duplicate ident.ID conversions (#935)
Browse files Browse the repository at this point in the history
* Avoid duplicate ident.ID conversions
  • Loading branch information
nikunjgit authored Sep 25, 2018
1 parent eef049a commit ed1dc9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/query/storage/m3/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ func (s *m3storage) Write(
}

id := query.Tags.ID()
// TODO: Consider caching id -> identID
identID := ident.StringID(id)
common := &writeRequestCommon{
store: s,
annotation: query.Annotation,
unit: query.Unit,
id: id,
id: identID,
tagIterator: storage.TagsToIdentTagIterator(query.Tags),
attributes: query.Attributes,
}
Expand All @@ -282,7 +284,7 @@ func (s *m3storage) Close() error {
func (w *writeRequest) Process(ctx context.Context) error {
common := w.writeRequestCommon
store := common.store
id := ident.StringID(common.id)
id := common.id

var (
namespace ClusterNamespace
Expand Down Expand Up @@ -321,7 +323,7 @@ type writeRequestCommon struct {
store *m3storage
annotation []byte
unit xtime.Unit
id string
id ident.ID
tagIterator ident.TagIterator
attributes storage.Attributes
}
Expand Down

0 comments on commit ed1dc9f

Please sign in to comment.