Skip to content

Commit

Permalink
scollectd: change get_collectd_value() to use const ref
Browse files Browse the repository at this point in the history
After the implementation of the code that uses the scollectd API was
modified, the get_collectd_value gets the collectd ID as a const
reference, to remove unnessary creation of shared_ptr.

Signed-off-by: Amnon Heiman <[email protected]>
  • Loading branch information
amnonh authored and avikivity committed Jul 6, 2015
1 parent a4a23f8 commit 2c08647
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/scollectd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ boost::program_options::options_description get_options_description() {
}

std::vector<collectd_value> get_collectd_value(
shared_ptr<scollectd::type_instance_id> id) {
const scollectd::type_instance_id& id) {
std::vector<collectd_value> res_values;
auto raw_types = get_impl().get_values(*id);
auto raw_types = get_impl().get_values(id);
if (raw_types == nullptr) {
return res_values;
}
Expand Down
2 changes: 1 addition & 1 deletion core/scollectd_api.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct collectd_value {
};

std::vector<collectd_value> get_collectd_value(
shared_ptr<scollectd::type_instance_id> id);
const scollectd::type_instance_id& id);

std::vector<scollectd::type_instance_id> get_collectd_ids();

Expand Down

0 comments on commit 2c08647

Please sign in to comment.