summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-11-17 23:48:20 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-11-18 18:22:16 +0000
commitb2d2d0053d16ca15c9298f3e8312b494e246c5e9 (patch)
tree6a9670dae20080e9a59eca882962c4ced94e9640 /storage
parentd6975953e4284068fbd76e80bbf7e802003adcaf (diff)
No need to copy an empty object into another empty object.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/visiting/visitortest.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/getoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/persistencemessagetracker.cpp2
-rw-r--r--storage/src/vespa/storage/persistence/persistenceutil.cpp4
-rw-r--r--storage/src/vespa/storage/visiting/visitor.cpp5
6 files changed, 9 insertions, 10 deletions
diff --git a/storage/src/tests/visiting/visitortest.cpp b/storage/src/tests/visiting/visitortest.cpp
index 72668564345..8b16f3c92b6 100644
--- a/storage/src/tests/visiting/visitortest.cpp
+++ b/storage/src/tests/visiting/visitortest.cpp
@@ -799,7 +799,7 @@ TEST_F(VisitorTest, no_mbus_tracing_if_trace_level_is_zero) {
cmd->getTrace().setLevel(0);
std::shared_ptr<api::CreateVisitorReply> reply;
ASSERT_NO_FATAL_FAILURE(doCompleteVisitingSession(cmd, reply));
- EXPECT_TRUE(reply->getTrace().getRoot().isEmpty());
+ EXPECT_TRUE(reply->getTrace().isEmpty());
}
TEST_F(VisitorTest, reply_contains_trace_if_trace_level_above_zero) {
@@ -807,7 +807,7 @@ TEST_F(VisitorTest, reply_contains_trace_if_trace_level_above_zero) {
cmd->getTrace().setLevel(1);
std::shared_ptr<api::CreateVisitorReply> reply;
ASSERT_NO_FATAL_FAILURE(doCompleteVisitingSession(cmd, reply));
- EXPECT_FALSE(reply->getTrace().getRoot().isEmpty());
+ EXPECT_FALSE(reply->getTrace().isEmpty());
}
TEST_F(VisitorTest, no_more_iterators_sent_while_memory_used_above_limit) {
diff --git a/storage/src/vespa/storage/distributor/operations/external/getoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/getoperation.cpp
index c4fb9b8228c..cf7a0e4741e 100644
--- a/storage/src/vespa/storage/distributor/operations/external/getoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/getoperation.cpp
@@ -144,7 +144,7 @@ GetOperation::onReceive(DistributorMessageSender& sender, const std::shared_ptr<
LOG(debug, "Received %s", msg->toString(true).c_str());
- if ( ! getreply->getTrace().getRoot().isEmpty()) {
+ if ( ! getreply->getTrace().isEmpty()) {
_msg->getTrace().getRoot().addChild(getreply->getTrace().getRoot());
}
bool allDone = true;
diff --git a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
index 3866ee4e6f7..0b7d035ec0d 100644
--- a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
@@ -647,7 +647,7 @@ TwoPhaseUpdateOperation::satisfiesUpdateTimestampConstraint(api::Timestamp ts) c
void
TwoPhaseUpdateOperation::addTraceFromReply(const api::StorageReply& reply)
{
- if ( ! reply.getTrace().getRoot().isEmpty()) {
+ if ( ! reply.getTrace().isEmpty()) {
_trace.addChild(reply.getTrace().getRoot());
}
}
diff --git a/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp b/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
index 6362db6c002..6253beda6e1 100644
--- a/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
+++ b/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
@@ -292,7 +292,7 @@ PersistenceMessageTrackerImpl::updateFromReply(
api::BucketInfoReply& reply,
uint16_t node)
{
- if ( ! reply.getTrace().getRoot().isEmpty()) {
+ if ( ! reply.getTrace().isEmpty()) {
_trace.addChild(reply.getTrace().getRoot());
}
diff --git a/storage/src/vespa/storage/persistence/persistenceutil.cpp b/storage/src/vespa/storage/persistence/persistenceutil.cpp
index 42d67573763..37ef4c39597 100644
--- a/storage/src/vespa/storage/persistence/persistenceutil.cpp
+++ b/storage/src/vespa/storage/persistence/persistenceutil.cpp
@@ -93,7 +93,7 @@ MessageTracker::sendReply() {
_msg->toString(true).c_str(), vespalib::to_s(duration));
}
if (hasReply()) {
- if ( ! _context.getTrace().getRoot().isEmpty()) {
+ if ( ! _context.getTrace().isEmpty()) {
getReply().getTrace().getRoot().addChild(_context.getTrace().getRoot());
}
if (_updateBucketInfo) {
@@ -108,7 +108,7 @@ MessageTracker::sendReply() {
getReply().toString().c_str(), getReply().getMsgId());
_replySender.sendReplyDirectly(std::move(_reply));
} else {
- if ( ! _context.getTrace().getRoot().isEmpty()) {
+ if ( ! _context.getTrace().isEmpty()) {
_msg->getTrace().getRoot().addChild(_context.getTrace().getRoot());
}
}
diff --git a/storage/src/vespa/storage/visiting/visitor.cpp b/storage/src/vespa/storage/visiting/visitor.cpp
index 982bcd78f6f..2684ca03462 100644
--- a/storage/src/vespa/storage/visiting/visitor.cpp
+++ b/storage/src/vespa/storage/visiting/visitor.cpp
@@ -146,8 +146,7 @@ Visitor::BucketIterationState::~BucketIterationState()
{
if (_iteratorId != 0) {
// Making the assumption that this is effectively nothrow.
- std::shared_ptr<DestroyIteratorCommand> cmd(
- new DestroyIteratorCommand(_iteratorId));
+ auto cmd = std::make_shared<DestroyIteratorCommand>(_iteratorId);
cmd->setLoadType(_visitor._initiatingCmd->getLoadType());
cmd->getTrace().setLevel(_visitor._traceLevel);
cmd->setPriority(0);
@@ -178,7 +177,7 @@ Visitor::VisitorTarget::VisitorTarget()
{
}
-Visitor::VisitorTarget::~VisitorTarget() {}
+Visitor::VisitorTarget::~VisitorTarget() = default;
Visitor::Visitor(StorageComponent& component)
: _component(component),