Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21512] Set string arguments as const references #5179

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
Expand Down Expand Up @@ -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_(
Expand Down
Loading