From 682b4dff8fc5625a3c75d3cdd10a88e85a202e0c Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 15 Oct 2024 16:45:55 +0200 Subject: [PATCH 1/2] Refs #21694. Turn assertion into condition. Signed-off-by: Miguel Company --- src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp index 1a209ad2300..ddf71d24968 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp @@ -862,10 +862,8 @@ bool DataReaderHistory::update_instance_nts( change->reader_info.no_writers_generation_count = vit->second->no_writers_generation_count; auto current_owner = vit->second->current_owner.first; - if (current_owner != previous_owner) + if ( (current_owner != previous_owner) && (current_owner == change->writerGUID) ) { - assert(current_owner == change->writerGUID); - // Remove all changes from different owners after the change. DataReaderInstance::ChangeCollection& changes = vit->second->cache_changes; auto it = std::lower_bound(changes.begin(), changes.end(), change, rtps::history_order_cmp); From 682265bfa4eb996e09e2072cc3d4323082b907c3 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 16 Oct 2024 11:56:24 +0200 Subject: [PATCH 2/2] Refs #21694. Fix uncrustify. Signed-off-by: Miguel Company --- src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp index ddf71d24968..2ce615f1933 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp @@ -862,7 +862,7 @@ bool DataReaderHistory::update_instance_nts( change->reader_info.no_writers_generation_count = vit->second->no_writers_generation_count; auto current_owner = vit->second->current_owner.first; - if ( (current_owner != previous_owner) && (current_owner == change->writerGUID) ) + if ((current_owner != previous_owner) && (current_owner == change->writerGUID)) { // Remove all changes from different owners after the change. DataReaderInstance::ChangeCollection& changes = vit->second->cache_changes;