Skip to content

Commit

Permalink
Refs #12133. Continue the search after found a future change
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed Jul 16, 2021
1 parent 864d469 commit 3fdfa93
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,39 +140,38 @@ struct ReadTakeCommand

// If the change is in the future we can skip the remaining changes in the history, as they will be
// in the future also
if (is_future_change)
if (!is_future_change)
{
break;
}

// Add sample and info to collections
ReturnCode_t previous_return_value = return_value_;
bool added = add_sample(change, remove_change);
reader_->end_sample_access_nts(change, wp, added);

// Check if the payload is dirty
if (added && !check_datasharing_validity(change, data_values_.has_ownership(), wp))
{
// Decrement length of collections
--current_slot_;
++remaining_samples_;
data_values_.length(current_slot_);
sample_infos_.length(current_slot_);

return_value_ = previous_return_value;
finished_ = false;

remove_change = true;
added = false;
}

if (remove_change || (added && take_samples))
{
// Remove from history
history_.remove_change_sub(change, it);

// Current iterator will point to change next to the one removed. Avoid incrementing.
continue;
// Add sample and info to collections
ReturnCode_t previous_return_value = return_value_;
bool added = add_sample(change, remove_change);
reader_->end_sample_access_nts(change, wp, added);

// Check if the payload is dirty
if (added && !check_datasharing_validity(change, data_values_.has_ownership(), wp))
{
// Decrement length of collections
--current_slot_;
++remaining_samples_;
data_values_.length(current_slot_);
sample_infos_.length(current_slot_);

return_value_ = previous_return_value;
finished_ = false;

remove_change = true;
added = false;
}

if (remove_change || (added && take_samples))
{
// Remove from history
history_.remove_change_sub(change, it);

// Current iterator will point to change next to the one removed. Avoid incrementing.
continue;
}
}
}

Expand Down

0 comments on commit 3fdfa93

Please sign in to comment.