aboutsummaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-02-24 14:24:59 +0100
committerGitHub <noreply@github.com>2020-02-24 14:24:59 +0100
commitb10d3da883dc12fcd49d240eb5551de8c2e2198e (patch)
tree67e8613cd966655e7270b4c20d7b6e19cf6a9b80 /fnet
parente87d45c158803e006aa605cb89c7287011068330 (diff)
parent173a11d450c548908239ebdea303478eec848c22 (diff)
Merge pull request #12315 from vespa-engine/balder/follow-intellij-advise
Follow clion advise
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/tests/frt/values/values_test.cpp1
-rw-r--r--fnet/src/vespa/fnet/frt/rpcrequest.h1
-rw-r--r--fnet/src/vespa/fnet/frt/values.cpp5
-rw-r--r--fnet/src/vespa/fnet/frt/values.h5
4 files changed, 8 insertions, 4 deletions
diff --git a/fnet/src/tests/frt/values/values_test.cpp b/fnet/src/tests/frt/values/values_test.cpp
index 5bc6b0e2dce..3b36e8989c1 100644
--- a/fnet/src/tests/frt/values/values_test.cpp
+++ b/fnet/src/tests/frt/values/values_test.cpp
@@ -3,6 +3,7 @@
#include <vespa/fnet/frt/values.h>
#include <vespa/fnet/databuffer.h>
#include <vespa/fnet/info.h>
+#include <vespa/vespalib/util/stash.h>
using vespalib::Stash;
diff --git a/fnet/src/vespa/fnet/frt/rpcrequest.h b/fnet/src/vespa/fnet/frt/rpcrequest.h
index cc871e7ac0c..eaa34a46b7a 100644
--- a/fnet/src/vespa/fnet/frt/rpcrequest.h
+++ b/fnet/src/vespa/fnet/frt/rpcrequest.h
@@ -5,6 +5,7 @@
#include "values.h"
#include "error.h"
#include <vespa/fnet/context.h>
+#include <vespa/vespalib/util/stash.h>
#include <atomic>
class FNETConnection;
diff --git a/fnet/src/vespa/fnet/frt/values.cpp b/fnet/src/vespa/fnet/frt/values.cpp
index a5f59df19b2..3b37aa9a1bc 100644
--- a/fnet/src/vespa/fnet/frt/values.cpp
+++ b/fnet/src/vespa/fnet/frt/values.cpp
@@ -3,6 +3,7 @@
#include "values.h"
#include <vespa/fnet/databuffer.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/util/stash.h>
#include <cassert>
static_assert(sizeof(uint8_t) == 1, "uint8_t must be 1 byte.");
@@ -81,7 +82,7 @@ FRT_Values::FRT_Values(Stash &stash)
_stash(stash)
{ }
-FRT_Values::~FRT_Values() { }
+FRT_Values::~FRT_Values() = default;
LocalBlob::LocalBlob(const char *data, uint32_t len) :
_data(Alloc::alloc(len)),
@@ -294,7 +295,7 @@ FRT_Values::AddSharedData(FRT_ISharedBlob *blob) {
}
void
-FRT_Values::AddData(vespalib::alloc::Alloc buf, uint32_t len) {
+FRT_Values::AddData(vespalib::alloc::Alloc && buf, uint32_t len) {
AddSharedData(&_stash.create<LocalBlob>(std::move(buf), len));
}
diff --git a/fnet/src/vespa/fnet/frt/values.h b/fnet/src/vespa/fnet/frt/values.h
index e00aec8423c..2aa7551c423 100644
--- a/fnet/src/vespa/fnet/frt/values.h
+++ b/fnet/src/vespa/fnet/frt/values.h
@@ -3,9 +3,10 @@
#pragma once
#include "isharedblob.h"
-#include <vespa/vespalib/util/stash.h>
#include <cstring>
+namespace vespalib { class Stash; }
+namespace vespalib::alloc { class Alloc; }
namespace fnet {
char * copyString(char *dst, const char *src, size_t len);
char * copyData(char *dst, const void *src, size_t len);
@@ -216,7 +217,7 @@ public:
char *AddString(uint32_t len);
FRT_StringValue *AddStringArray(uint32_t len);
void AddSharedData(FRT_ISharedBlob *blob);
- void AddData(Alloc buf, uint32_t len);
+ void AddData(Alloc && buf, uint32_t len);
void AddData(const char *buf, uint32_t len);
char *AddData(uint32_t len);
FRT_DataValue *AddDataArray(uint32_t len);