Skip to content

Commit

Permalink
a few keller-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Apr 23, 2024
1 parent d6b0709 commit f82d20d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions ecal/core/include/ecal/ecal_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ namespace eCAL

bool operator<(const SServiceMethod& other) const
{
if (service_name != other.service_name)
return service_name < other.service_name;
return method_name < other.method_name;
return std::tie(service_name, method_name) < std::tie(other.service_name, other.method_name);
}
};
using QualityServiceInfoMultimap = std::multimap<SServiceMethod, SQualityServiceInfo>;
Expand Down
11 changes: 3 additions & 8 deletions ecal/core/src/ecal_descgate.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <map>
#include <mutex>
#include <string>
#include <tuple>

namespace eCAL
{
Expand All @@ -43,9 +44,7 @@ namespace eCAL

bool operator<(const STopicIdKey& other) const
{
if (topic_name != other.topic_name)
return topic_name < other.topic_name;
return topic_id < other.topic_id;
return std::tie(topic_name, topic_id) < std::tie(other.topic_name, other.topic_id);
}
};

Expand All @@ -57,11 +56,7 @@ namespace eCAL

bool operator<(const SServiceIdKey& other) const
{
if (service_name != other.service_name)
return service_name < other.service_name;
if (service_id != other.service_id)
return service_id < other.service_id;
return method_name < other.method_name;
return std::tie(service_name, service_id) < std::tie(other.service_name, other.service_id);
}
};

Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/ecal_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace
*
* @return Set of SQualityTopicInfo
**/
std::set<eCAL::Util::SQualityTopicInfo> GetQualityTopicInfoSet(const std::string& topic_name_, const std::multimap<std::string, eCAL::Util::SQualityTopicInfo>& quality_data_type_info_multi_map_)
std::set<eCAL::Util::SQualityTopicInfo> GetQualityTopicInfoSet(const std::string& topic_name_, const eCAL::Util::QualityTopicInfoMultiMap& quality_data_type_info_multi_map_)
{
std::set<eCAL::Util::SQualityTopicInfo> quality_topic_info_set;

Expand All @@ -60,7 +60,7 @@ namespace
*
* @return Set of SQualityServiceInfo
**/
std::set<eCAL::Util::SQualityServiceInfo> GetQualityServiceInfoSet(const std::string& service_name_, const std::string& method_name_, std::multimap<eCAL::Util::SServiceMethod, eCAL::Util::SQualityServiceInfo> quality_service_info_multi_map_)
std::set<eCAL::Util::SQualityServiceInfo> GetQualityServiceInfoSet(const std::string& service_name_, const std::string& method_name_, const eCAL::Util::QualityServiceInfoMultimap& quality_service_info_multi_map_)
{
std::set<eCAL::Util::SQualityServiceInfo> quality_service_info_set;

Expand Down

0 comments on commit f82d20d

Please sign in to comment.