lifecycle worker: fix potential inifinite loop
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Alex 2023-08-31 11:29:54 +02:00
parent a00a52633f
commit f579d6d9b4

View file

@ -193,7 +193,10 @@ impl Worker for LifecycleWorker {
if skip == Skip::SkipBucket { if skip == Skip::SkipBucket {
let bucket_id_len = object.bucket_id.as_slice().len(); let bucket_id_len = object.bucket_id.as_slice().len();
assert_eq!(pos.get(..bucket_id_len), Some(object.bucket_id.as_slice())); assert_eq!(pos.get(..bucket_id_len), Some(object.bucket_id.as_slice()));
*pos = [&pos[..bucket_id_len], &[0xFFu8][..]].concat(); *pos = std::cmp::max(
next_pos,
[&pos[..bucket_id_len], &[0xFFu8][..]].concat(),
);
} else { } else {
*pos = next_pos; *pos = next_pos;
} }