Skip to content

Commit

Permalink
fix: fix slice init length
Browse files Browse the repository at this point in the history
Signed-off-by: cuishuang <[email protected]>
  • Loading branch information
cuishuang committed Sep 26, 2024
1 parent 9aab2f5 commit 0295afd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions runtime/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func walkCommits(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData, er
fields = builder.possibleTables[s.Tables[0]]
}
resultFields := fields // These are the fields in output with wildcards expanded
rows := make([]tableRow, s.Limit)
rows := make([]tableRow, 0, s.Limit)
usingOrder := false
if s.Order != nil && !s.Count {
usingOrder = true
Expand Down Expand Up @@ -107,7 +107,7 @@ func walkCommits(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData, er

func metadataCommit(identifier string, commit *object.Commit) string {
key := ""
for key, _ = range builder.tables {
for key = range builder.tables {
break
}
table := key
Expand Down
4 changes: 2 additions & 2 deletions runtime/reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func walkReferences(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData,
fields = builder.possibleTables[s.Tables[0]]
}

rows := make([]tableRow, s.Limit)
rows := make([]tableRow, 0, s.Limit)
usingOrder := false
if s.Order != nil && !s.Count {
usingOrder = true
Expand Down Expand Up @@ -88,7 +88,7 @@ func walkReferences(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData,

func metadataReference(identifier string, ref *plumbing.Reference) string {
key := ""
for key, _ = range builder.tables {
for key = range builder.tables {
break
}
table := key
Expand Down

0 comments on commit 0295afd

Please sign in to comment.