Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #102 from grafana/20220719_fix-bug-with-string-sli…
Browse files Browse the repository at this point in the history
…ce-length

Fix string slice length bug
  • Loading branch information
simonswine authored Jul 19, 2022
2 parents de676bc + a54274b commit 0bdac21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/firedb/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ func (*stringsHelper) key(s string) string {
}

func (*stringsHelper) addToRewriter(r *rewriter, m idConversionTable) {
r.strings = make(stringConversionTable, len(m))
var maxID int64
for id := range m {
if id > maxID {
maxID = id
}
}
r.strings = make(stringConversionTable, maxID+1)

for x, y := range m {
r.strings[x] = y
}
Expand Down

0 comments on commit 0bdac21

Please sign in to comment.