Skip to content

Commit

Permalink
Merge pull request #2253 from joto/more-const-ref
Browse files Browse the repository at this point in the history
Use const ref params in properties code
  • Loading branch information
lonvia authored Sep 18, 2024
2 parents 55d1592 + c42e0f6 commit 9b283f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ void properties_t::set_string(std::string const &property,
m_to_update[property] = value;
}

void properties_t::set_int(std::string property, int64_t value)
void properties_t::set_int(std::string const &property, int64_t value)
{
set_string(std::move(property), std::to_string(value));
set_string(property, std::to_string(value));
}

void properties_t::set_bool(std::string property, bool value)
void properties_t::set_bool(std::string const &property, bool value)
{
set_string(std::move(property), value ? "true" : "false");
set_string(property, value ? "true" : "false");
}

void properties_t::init_table()
Expand Down
4 changes: 2 additions & 2 deletions src/properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class properties_t
* \param property Name of the property
* \param value Value of the property
*/
void set_int(std::string property, int64_t value);
void set_int(std::string const &property, int64_t value);

/**
* Set property to boolean value. In the database this will show up as the
Expand All @@ -72,7 +72,7 @@ class properties_t
* \param property Name of the property
* \param value Value of the property
*/
void set_bool(std::string property, bool value);
void set_bool(std::string const &property, bool value);

/**
* Initialize the database table 'osm2pgsql_properties'. It is created if
Expand Down

0 comments on commit 9b283f6

Please sign in to comment.