diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-12-01 00:03:26 -0500 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-01-12 16:53:38 -0500 |
| commit | d1bbf3a71adfd70fbeefb0f709e2892b7c109860 (patch) | |
| tree | 753ba8d606caa4569e6e2878b8f45d16d8ec8e7c | |
| parent | 22cfbe6771a4c5ff90ea8552538584561e6416e1 (diff) | |
| download | phosphor-inventory-manager-d1bbf3a71adfd70fbeefb0f709e2892b7c109860.tar.gz phosphor-inventory-manager-d1bbf3a71adfd70fbeefb0f709e2892b7c109860.zip | |
Fix a bug with property change filter
With strings, propertyChangedTo is instantiated with const char*
resulting in the typical pointer x == y comparison bug.
Fix by first converting to std::string.
Change-Id: I51fe5f3746b8dd8ca094e4662103d41f75e2972f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
| -rw-r--r-- | events.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -136,7 +136,7 @@ struct PropertyCondition if(it == properties.cend()) return false; - return _condition(it->second); + return _condition(it->second.template get<T>()); } private: @@ -161,7 +161,10 @@ auto propertyChangedTo( const char *property, T val) { - auto condition = [val = std::move(val)](auto arg){return arg == val;}; + auto condition = [val = std::move(val)](const std::string &arg) + { + return arg == val; + }; using U = decltype(condition); return details::property_condition::PropertyCondition<T, U>( iface, property, std::move(condition)); |

