mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 11:46:40 +00:00
[bugfix] panic during child thread iteration (#852)
* *actually* start at top of stack loop on find remote child, fix iter indexing Signed-off-by: kim <grufwub@gmail.com> * add improved code comment Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
7a1aa04bbb
commit
82061b1202
|
@ -235,11 +235,11 @@ type frame struct {
|
|||
|
||||
// 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 @@ type frame struct {
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue