presence: optimize emplace_back
The emplace_back call is created using temporary strings obtained from a
substr call which are not used past that point. Use std::move to avoid
string copy during the emplacement.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5b0c7eebfd7281a2be379192ccdb0b2e5e4d5828
diff --git a/presence/main.cpp b/presence/main.cpp
index 56ab8a1..96f6f8f 100644
--- a/presence/main.cpp
+++ b/presence/main.cpp
@@ -45,7 +45,7 @@
auto path = entry.substr(0, pos);
auto device = entry.substr(pos + 1);
- drivers.emplace_back(device, path);
+ drivers.emplace_back(std::move(device), std::move(path));
}
else
{