Skip to content

Commit

Permalink
Fix map allocation bug in materialize.go
Browse files Browse the repository at this point in the history
Solution to cayleygraph#911
  • Loading branch information
virtualgraham authored and dennwc committed Jan 9, 2020
1 parent 0f70528 commit b8f0b68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graph/iterator/materialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (it *materializeNext) materializeSet(ctx context.Context) {
tags := make(map[string]refs.Ref, mn)
it.next.TagResults(tags)
if n := len(tags); n > mn {
n = mn
mn = n
}
it.values[index] = append(it.values[index], result{id: id, tags: tags})
for it.next.NextPath(ctx) {
Expand All @@ -232,7 +232,7 @@ func (it *materializeNext) materializeSet(ctx context.Context) {
tags := make(map[string]refs.Ref, mn)
it.next.TagResults(tags)
if n := len(tags); n > mn {
n = mn
mn = n
}
it.values[index] = append(it.values[index], result{id: id, tags: tags})
}
Expand Down

0 comments on commit b8f0b68

Please sign in to comment.