X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ecd5f7562caf1d443bf22788fa5f4fac408776ec..ebc355d0c96552d0bc2aa301d90723490337bca3:/src/surf/PropertyHolder.cpp diff --git a/src/surf/PropertyHolder.cpp b/src/surf/PropertyHolder.cpp index 629870643b..39be42b685 100644 --- a/src/surf/PropertyHolder.cpp +++ b/src/surf/PropertyHolder.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -13,7 +13,7 @@ PropertyHolder::~PropertyHolder() { } /** @brief Return the property associated to the provided key (or nullptr if not existing) */ -const char* PropertyHolder::getProperty(std::string key) +const char* PropertyHolder::get_property(const std::string& key) { if (properties_ == nullptr) return nullptr; @@ -22,18 +22,18 @@ const char* PropertyHolder::getProperty(std::string key) } /** @brief Change the value of a given key in the property set */ -void PropertyHolder::setProperty(std::string key, std::string value) +void PropertyHolder::set_property(const std::string& key, const std::string& value) { if (not properties_) - properties_ = new std::map; + properties_ = new std::unordered_map; (*properties_)[key] = value; } /** @brief Return the whole set of properties. Don't mess with it, dude! */ -std::map* PropertyHolder::getProperties() +std::unordered_map* PropertyHolder::get_properties() { if (not properties_) - properties_ = new std::map; + properties_ = new std::unordered_map; return properties_; }