Skip to content

Commit 044831a

Browse files
committed
add comment
1 parent 10ab066 commit 044831a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

db/change_cache.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,8 @@ func (c *changeCache) _addToCache(ctx context.Context, change *LogEntry) []chann
876876
// Returns the channels that changed. This may return the same channel more than once, channels should be deduplicated
877877
// before notifying the changes.
878878
func (c *changeCache) _addPendingLogs(ctx context.Context) []channels.ID {
879+
// pre allocate slice for changed channels, give size 5 to allow for some headroom so we
880+
// aren't constantly growing the slice
879881
changedChannels := make([]channels.ID, 0, 5)
880882
var isNext bool
881883

0 commit comments

Comments
 (0)