implement count rpc
This commit is contained in:
@ -75,7 +75,12 @@ func ApplyOptsToUpdates(updates []*weather.WeatherUpdate, limit int, opts *pb.Ge
|
||||
return updates
|
||||
}
|
||||
|
||||
filtered := make([]*weather.WeatherUpdate, 0, limit)
|
||||
capacity := len(updates)
|
||||
if limit > 0 {
|
||||
capacity = limit
|
||||
}
|
||||
|
||||
filtered := make([]*weather.WeatherUpdate, 0, capacity)
|
||||
|
||||
for i := len(updates) - 1; i >= 0; i-- {
|
||||
update := updates[i]
|
||||
|
Reference in New Issue
Block a user