Skip to content

Commit

Permalink
Refs #20742: Add Miguel' suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso committed Apr 26, 2024
1 parent 1db708d commit e9e08fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cpp/fastdds/subscriber/DataReaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,15 +1787,20 @@ DataReaderListener* DataReaderImpl::get_listener_for(
std::shared_ptr<IPayloadPool> DataReaderImpl::get_payload_pool()
{
// Check whether DataReader's type is plain in all its data representations
bool is_plain = type_->is_plain();
bool is_plain = true;
if (qos_.type_consistency().representation.m_value.size() > 0)
{
is_plain = true;
for (auto data_representation : qos_.type_consistency().representation.m_value)
{
is_plain = is_plain && type_->is_plain(data_representation);
}
}
// If data representation is not defined, consider both XCDR representations
else
{
is_plain = type_->is_plain(DataRepresentationId_t::XCDR_DATA_REPRESENTATION)
&& type_->is_plain(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION);
}

// When the user requested PREALLOCATED_WITH_REALLOC, but we know the type cannot
// grow, we translate the policy into bare PREALLOCATED
Expand Down

0 comments on commit e9e08fd

Please sign in to comment.