diff --git a/include/fastdds/rtps/common/CacheChange.h b/include/fastdds/rtps/common/CacheChange.h index 1059006ae2a..4b3d9d0221f 100644 --- a/include/fastdds/rtps/common/CacheChange.h +++ b/include/fastdds/rtps/common/CacheChange.h @@ -269,8 +269,7 @@ struct RTPS_DllAPI CacheChange_t { // Keep index of next fragment on the payload portion at the beginning of each fragment. Last // fragment will have fragment_count_ as 'next fragment index' - size_t offset = 0; - for (uint32_t i = 1; i <= fragment_count_; i++, offset += fragment_size_) + for (uint32_t i = 1; i <= fragment_count_; i++) { set_next_missing_fragment(i - 1, i); // index to next fragment in missing list }