Skip to content

Commit 9b283f6

Browse files
authored
Merge pull request #2253 from joto/more-const-ref
Use const ref params in properties code
2 parents 55d1592 + c42e0f6 commit 9b283f6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/properties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ void properties_t::set_string(std::string const &property,
9090
m_to_update[property] = value;
9191
}
9292

93-
void properties_t::set_int(std::string property, int64_t value)
93+
void properties_t::set_int(std::string const &property, int64_t value)
9494
{
95-
set_string(std::move(property), std::to_string(value));
95+
set_string(property, std::to_string(value));
9696
}
9797

98-
void properties_t::set_bool(std::string property, bool value)
98+
void properties_t::set_bool(std::string const &property, bool value)
9999
{
100-
set_string(std::move(property), value ? "true" : "false");
100+
set_string(property, value ? "true" : "false");
101101
}
102102

103103
void properties_t::init_table()

src/properties.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class properties_t
6363
* \param property Name of the property
6464
* \param value Value of the property
6565
*/
66-
void set_int(std::string property, int64_t value);
66+
void set_int(std::string const &property, int64_t value);
6767

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

7777
/**
7878
* Initialize the database table 'osm2pgsql_properties'. It is created if

0 commit comments

Comments
 (0)