forked from TrueCloudLab/frostfs-node
[#53] object/range: Do not add chain element without the need
In previous implementation one excess element could be added to the chain. Add previous sibling presence check to prevent this. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>support/v0.27
parent
7813b90554
commit
759605410a
|
@ -97,9 +97,11 @@ func (c *rangeTraverser) pushHeader(obj *object.Object) {
|
|||
|
||||
c.chain = c.chain.prev
|
||||
|
||||
c.chain.prev = &rangeChain{
|
||||
next: c.chain,
|
||||
id: obj.GetPreviousID(),
|
||||
if prev := obj.GetPreviousID(); prev != nil {
|
||||
c.chain.prev = &rangeChain{
|
||||
next: c.chain,
|
||||
id: prev,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue