From d8c56f1d19814d3b5ac63876982798a9a4d64b53 Mon Sep 17 00:00:00 2001 From: Drew Lewis Date: Tue, 21 Apr 2026 17:59:38 -0400 Subject: [PATCH] Make defineProperty take handler by const& and clean up std::moves (#427) Signed-off-by: Drew Lewis --- include/sta/Property.hh | 20 ++++++++++---------- search/Property.cc | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/sta/Property.hh b/include/sta/Property.hh index e5834b61..adeee3cc 100644 --- a/include/sta/Property.hh +++ b/include/sta/Property.hh @@ -99,25 +99,25 @@ public: // return PropertyValue("bar"); // }); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); void defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler); + const PropertyRegistry::PropertyHandler &handler); protected: PropertyValue portSlew(const Port *port, diff --git a/search/Property.cc b/search/Property.cc index bef9ebb0..fe848d5e 100644 --- a/search/Property.cc +++ b/search/Property.cc @@ -1265,70 +1265,70 @@ Properties::capacitancePropertyValue(float cap) void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_library_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_liberty_library_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_cell_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_liberty_cell_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_port_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_liberty_port_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_instance_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_pin_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_net_.defineProperty(property, handler); } void Properties::defineProperty(std::string_view property, - PropertyRegistry::PropertyHandler &handler) + const PropertyRegistry::PropertyHandler &handler) { registry_clock_.defineProperty(property, handler); } @@ -1355,7 +1355,7 @@ void PropertyRegistry::defineProperty(std::string_view property, PropertyHandler handler) { - registry_[std::string(property)] = std::move(std::move(std::move(std::move(std::move(std::move(std::move(std::move(std::move(std::move(handler)))))))))); + registry_[std::string(property)] = std::move(handler); } } // namespace sta