mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 07:42: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
|
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
|
lo = statuses[len(statuses)-1].ID
|
||||||
|
|
||||||
// Convert to our cache type,
|
// Convert to our cache type,
|
||||||
|
|
@ -522,8 +525,10 @@ func (t *StatusTimeline) Load(
|
||||||
|
|
||||||
if len(justLoaded) > 0 {
|
if len(justLoaded) > 0 {
|
||||||
if hi == "" {
|
if hi == "" {
|
||||||
// No previously cached, set
|
// Check whether a hi value was set
|
||||||
// hi paging value from loaded.
|
// 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
|
hi = justLoaded[0].ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue