mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-28 03:11:01 +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
1 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue