perform_probe: fix clang-tidy modernize-use-emplace warning
Fix the following warning with clang-tidy-17:
```
../src/perform_probe.cpp:207:19: error: use emplace_back instead of push_back [modernize-use-emplace,-warnings-as-errors]
207 | foundDevs.push_back(
| ^~~~~~~~~~
| emplace_back(
208 | {boost::container::flat_map<std::string, DBusValueVariant>{},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209 | std::string{}});
| ~~~~~~~~~~~~~~
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I70bcaa9ce8dc1b62e537bbb8c9ba0f76db867bf1
diff --git a/src/perform_probe.cpp b/src/perform_probe.cpp
index 1ef8bb2..71280d8 100644
--- a/src/perform_probe.cpp
+++ b/src/perform_probe.cpp
@@ -68,11 +68,7 @@
std::cerr << "probeDBus: Found probe match on " << path << " "
<< interfaceName << "\n";
}
- // Use emplace back when clang implements
- // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html
- //
- // https://en.cppreference.com/w/cpp/compiler_support/20
- devices.push_back({interface, path});
+ devices.emplace_back(interface, path);
foundMatch = true;
}
}
@@ -200,13 +196,9 @@
// probe passed, but empty device
if (ret && foundDevs.empty())
{
- // Use emplace back when clang implements
- // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html
- //
- // https://en.cppreference.com/w/cpp/compiler_support/20
- foundDevs.push_back(
- {boost::container::flat_map<std::string, DBusValueVariant>{},
- std::string{}});
+ foundDevs.emplace_back(
+ boost::container::flat_map<std::string, DBusValueVariant>{},
+ std::string{});
}
if (matchOne && ret)
{