From 10d2c12c6f275f9b1684db256fbc52dd5ae7aaa9 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 1 Apr 2025 14:04:32 +0100 Subject: [PATCH] improved code comments for updated / returned lo , hi paging values --- internal/cache/timeline/status.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/cache/timeline/status.go b/internal/cache/timeline/status.go index b527125e6..e64fd3815 100644 --- a/internal/cache/timeline/status.go +++ b/internal/cache/timeline/status.go @@ -467,7 +467,10 @@ func (t *StatusTimeline) Load( continue } - // Update returned lo paging value. + // On each iteration, since statuses + // returned will always be in DESC order, + // iteratively update the lo paging value + // that we return for next / prev pages. lo = statuses[len(statuses)-1].ID // Convert to our cache type, @@ -522,8 +525,10 @@ func (t *StatusTimeline) Load( if len(justLoaded) > 0 { if hi == "" { - // No previously cached, set - // hi paging value from loaded. + // Check whether a hi value was set + // from an initial load of cached entries, + // if not we set the returned hi paging + // value from first in loaded statuses. hi = justLoaded[0].ID }