summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/thread.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/dereferencing/thread.go')
-rw-r--r--internal/federation/dereferencing/thread.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/federation/dereferencing/thread.go b/internal/federation/dereferencing/thread.go
index d15f05964..7626454a6 100644
--- a/internal/federation/dereferencing/thread.go
+++ b/internal/federation/dereferencing/thread.go
@@ -235,11 +235,11 @@ stackLoop:
// Start off the item iterator
current.itemIter = items.Begin()
- current.iterIdx = -1
+ current.iterIdx = 0
}
itemLoop:
- for current.iterIdx++; current.iterIdx < current.iterLen; current.iterIdx++ {
+ for ; current.iterIdx < current.iterLen; current.iterIdx++ {
var itemIRI *url.URL
// Get next item iterator object
@@ -275,11 +275,21 @@ stackLoop:
continue itemLoop
}
+ // Iter past this item. Normally this would be
+ // handled by the third clause of the itemLoop's
+ // embedded range checking, but at the bottom of this
+ // loop since we found a new status we circle back to
+ // the beginning of the stackLoop and skip iteration.
+ current.iterIdx++
+
// Put current and next frame at top of stack
stack = append(stack, current, &frame{
statusIRI: itemIRI,
statusable: statusable,
})
+
+ // Now start at top of loop
+ continue stackLoop
}
// Item iterator is done