Skip to content

Commit

Permalink
Revert "graphql: avoid greedy allocation (ethereum#27873)"
Browse files Browse the repository at this point in the history
This reverts commit 8257f41.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent dc2ecf6 commit bf2b9a7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions graphql/graphql.go
Expand Up @@ -1250,7 +1250,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
if to < from {
return []*Block{}, nil
}
var ret []*Block
ret := make([]*Block, 0, to-from+1)
for i := from; i <= to; i++ {
numberOrHash := rpc.BlockNumberOrHashWithNumber(i)
block := &Block{
Expand All @@ -1268,9 +1268,6 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
break
}
ret = append(ret, block)
if err := ctx.Err(); err != nil {
return nil, err
}
}
return ret, nil
}
Expand Down

0 comments on commit bf2b9a7

Please sign in to comment.