mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 14:42:24 -05:00
[feature] tentatively start adding polls support (#2249)
This commit is contained in:
parent
297b6eeaaa
commit
c6e00afc7c
36 changed files with 657 additions and 393 deletions
|
|
@ -222,7 +222,7 @@ func (t *timeline) getXBetweenIDs(ctx context.Context, amount int, behindID stri
|
|||
// a point where the items are out of the range
|
||||
// we're interested in.
|
||||
rangeF = func(e *list.Element) (bool, error) {
|
||||
entry := e.Value.(*indexedItemsEntry) //nolint:forcetypeassert
|
||||
entry := e.Value.(*indexedItemsEntry)
|
||||
|
||||
if entry.itemID >= behindID {
|
||||
// ID of this item is too high,
|
||||
|
|
@ -276,7 +276,6 @@ func (t *timeline) getXBetweenIDs(ctx context.Context, amount int, behindID stri
|
|||
// Move the mark back one place each loop.
|
||||
beforeIDMark = e
|
||||
|
||||
//nolint:forcetypeassert
|
||||
if entry := e.Value.(*indexedItemsEntry); entry.itemID <= beforeID {
|
||||
// We've gone as far as we can through
|
||||
// the list and reached entries that are
|
||||
|
|
@ -319,7 +318,7 @@ func (t *timeline) getXBetweenIDs(ctx context.Context, amount int, behindID stri
|
|||
// To preserve ordering, we need to reverse the slice
|
||||
// when we're finished.
|
||||
for e := beforeIDMark; e != nil; e = e.Prev() {
|
||||
entry := e.Value.(*indexedItemsEntry) //nolint:forcetypeassert
|
||||
entry := e.Value.(*indexedItemsEntry)
|
||||
|
||||
if entry.itemID == beforeID {
|
||||
// Don't include the beforeID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue