Skip to content

Commit

Permalink
fix: minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 25, 2024
1 parent ad66379 commit c55ce90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion node/pkg/dal/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func getLatestFeeds(c *fiber.Ctx) error {
}

symbols := strings.Split(symbolsStr, ",")
results := []*dalcommon.OutgoingSubmissionData{}
results := make([]*dalcommon.OutgoingSubmissionData, 0, len(symbols))
for _, symbol := range symbols {
if symbol == "" {
continue
Expand Down
8 changes: 3 additions & 5 deletions node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,11 @@ func (c *Collector) GetLatestData(symbol string) (*dalcommon.OutgoingSubmissionD
}

func (c *Collector) GetAllLatestData() []dalcommon.OutgoingSubmissionData {
result := make([]dalcommon.OutgoingSubmissionData, 0)
result := make([]dalcommon.OutgoingSubmissionData, 0, len(c.Symbols))
c.LatestData.Range(func(key, value interface{}) bool {
data, ok := value.(*dalcommon.OutgoingSubmissionData)
if !ok {
return true
if data, ok := value.(*dalcommon.OutgoingSubmissionData); ok {
result = append(result, *data)
}
result = append(result, *data)
return true
})
return result
Expand Down

0 comments on commit c55ce90

Please sign in to comment.