summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-11-18 11:20:28 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-11-18 18:22:16 +0000
commit5708135b1ddbac03f268b6235027c10121cb5ca4 (patch)
tree5aff902eeac87f9a21de13942241725d8ba0193b /vespalib
parent37822a5c2ecf566bac41ea8a8c94226115ac370f (diff)
Move the Trace and TraceNode when adding traces.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/trace/trace.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/trace/trace.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/vespalib/src/tests/trace/trace.cpp b/vespalib/src/tests/trace/trace.cpp
index 9e9318bf4b8..9c8660fe395 100644
--- a/vespalib/src/tests/trace/trace.cpp
+++ b/vespalib/src/tests/trace/trace.cpp
@@ -261,7 +261,7 @@ TEST("testTraceDump")
b1.addChild(b2);
}
for (int i = 0; i < 10; ++i) {
- big.addChild(b1);
+ big.addChild(TraceNode(b1));
}
string normal = big.toString();
string full = big.getRoot().toString();
diff --git a/vespalib/src/vespa/vespalib/trace/trace.h b/vespalib/src/vespa/vespalib/trace/trace.h
index bad89bf6646..55d35f55617 100644
--- a/vespalib/src/vespa/vespalib/trace/trace.h
+++ b/vespalib/src/vespa/vespalib/trace/trace.h
@@ -107,7 +107,7 @@ public:
* @param child The child to add.
* @return This, to allow chaining.
*/
- void addChild(TraceNode child) {
+ void addChild(TraceNode && child) {
ensureRoot().addChild(std::move(child));
}