Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michel Hidalgo <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
  • Loading branch information
JLBuenoLopez and hidmic committed Oct 22, 2020
1 parent 2ece75b commit 445a526
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ class ServicePubListener : public eprosima::fastrtps::PublisherListener
const eprosima::fastrtps::rtps::GUID_t & guid)
{
// Check if the guid is still in the map
if (clients_endpoints_.find(guid) != clients_endpoints_.end()) {
// Wait for subscription
if (!wait_for_subscription(guid, std::chrono::milliseconds(100))) {
return client_present_t::MAYBE;
}
} else {
// Client has gone
if (clients_endpoints_.find(guid) == clients_endpoints_.end()) {
// Client is gone
return client_present_t::GONE;
}
// Wait for subscription
if (!wait_for_subscription(guid, std::chrono::milliseconds(100))) {
return client_present_t::MAYBE;
}
return client_present_t::YES;
}
Expand Down

0 comments on commit 445a526

Please sign in to comment.