Add contains type tidy check
On general container usage, contains() is more descriptive than count()
> 0. We have one violation of this, fix it and enable the check.
Tested: Clang-tidy passes.
Change-Id: Ib5702ef97c6da033b6587c9cfebbe30dfbfe80b4
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index b5d0127..1fec868 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -1230,7 +1230,7 @@
{
for (InventoryItem& inventoryItem : *inventoryItems)
{
- if (inventoryItem.sensors.count(sensorObjPath) > 0)
+ if (inventoryItem.sensors.contains(sensorObjPath))
{
return &inventoryItem;
}