mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 16:02:25 -05:00
improved code comments for updated / returned lo , hi paging values
This commit is contained in:
parent
158463908a
commit
10d2c12c6f
1 changed files with 8 additions and 3 deletions
11
internal/cache/timeline/status.go
vendored
11
internal/cache/timeline/status.go
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue