From 4124ad1c60db7188d16aaf8f86d0eead69d41a5e Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Wed, 28 Aug 2024 12:01:46 +0200 Subject: [PATCH] Refs #21512: Set string arguments as const references Signed-off-by: JesusPoderoso --- .../rtps/builtin/discovery/database/DiscoveryDataBase.cpp | 6 +++--- .../rtps/builtin/discovery/database/DiscoveryDataBase.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp index 72caa3ed2ba..a44828dfa14 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp @@ -376,7 +376,7 @@ bool DiscoveryDataBase::update( bool DiscoveryDataBase::update( eprosima::fastdds::rtps::CacheChange_t* change, - std::string topic_name) + const std::string& topic_name) { // in case the ddb is persistent, we store every cache in queue in a file if (is_persistent_ && guid_from_change(change).guidPrefix != server_guid_prefix_) @@ -1252,7 +1252,7 @@ void DiscoveryDataBase::match_writer_reader_( } bool DiscoveryDataBase::set_dirty_topic_( - std::string topic) + const std::string& topic) { EPROSIMA_LOG_INFO(DISCOVERY_DATABASE, "Setting topic " << topic << " as dirty"); @@ -2647,7 +2647,7 @@ void DiscoveryDataBase::clean_backup() } void DiscoveryDataBase::persistence_enable( - std::string backup_file_name) + const std::string& backup_file_name) { is_persistent_ = true; backup_file_name_ = backup_file_name; diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp index 5758c5a8f35..b09d2911d98 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp @@ -130,7 +130,7 @@ class DiscoveryDataBase */ bool update( eprosima::fastdds::rtps::CacheChange_t* change, - std::string topic_name); + const std::string& topic_name); bool update( eprosima::fastdds::rtps::CacheChange_t* change, @@ -144,7 +144,7 @@ class DiscoveryDataBase // enable ddb in persistence mode and open the file to backup up in append mode void persistence_enable( - std::string backup_file_name); + const std::string& backup_file_name); //! Disable the possibility to add new entries to the database void disable() @@ -498,7 +498,7 @@ class DiscoveryDataBase //! Add a topic to the list of dirty topics, unless it's already present // Return true if added, false if already there bool set_dirty_topic_( - std::string topic); + const std::string& topic); // Add data in pdp_to_send if not already in it bool add_pdp_to_send_(