From b431135550126e3ccfca9f95a0919e65c6c24aa0 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 20 Jun 2025 10:29:12 -0700 Subject: [PATCH] PropertyRegistry use string ref args Signed-off-by: James Cherry --- include/sta/Property.hh | 11 +++++------ search/Property.cc | 7 +++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/sta/Property.hh b/include/sta/Property.hh index 7e19b15c..ae94d715 100644 --- a/include/sta/Property.hh +++ b/include/sta/Property.hh @@ -46,17 +46,16 @@ template class PropertyRegistry { public: - void defineProperty(const std::string property, - std::function handler); + typedef std::function PropertyHandler; + void defineProperty(const std::string &property, + PropertyHandler handler); PropertyValue getProperty(TYPE object, - const std::string property, + const std::string &property, const char *type_name, Sta *sta); private: - std::map> registry_; + std::map registry_; }; class Properties diff --git a/search/Property.cc b/search/Property.cc index 1613e3ae..308803a9 100644 --- a/search/Property.cc +++ b/search/Property.cc @@ -1384,7 +1384,7 @@ Properties::defineProperty(std::string property, template PropertyValue PropertyRegistry::getProperty(TYPE object, - const std::string property, + const std::string &property, const char *type_name, Sta *sta) @@ -1398,9 +1398,8 @@ PropertyRegistry::getProperty(TYPE object, template void -PropertyRegistry::defineProperty(const std::string property, - std::function handler) +PropertyRegistry::defineProperty(const std::string &property, + PropertyHandler handler) { registry_[property] = handler; }