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>
This commit is contained in:
parent
7813b90554
commit
759605410a
1 changed files with 5 additions and 3 deletions
|
@ -97,9 +97,11 @@ func (c *rangeTraverser) pushHeader(obj *object.Object) {
|
||||||
|
|
||||||
c.chain = c.chain.prev
|
c.chain = c.chain.prev
|
||||||
|
|
||||||
|
if prev := obj.GetPreviousID(); prev != nil {
|
||||||
c.chain.prev = &rangeChain{
|
c.chain.prev = &rangeChain{
|
||||||
next: c.chain,
|
next: c.chain,
|
||||||
id: obj.GetPreviousID(),
|
id: prev,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue