aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Shestakov <tesseract@ydb.tech>2024-03-06 13:25:03 +0500
committerGitHub <noreply@github.com>2024-03-06 13:25:03 +0500
commitc8ffbe2351c35a80d804fc0380e223f0196d0b67 (patch)
tree5f659d6a06217800180c405509f08007149f8a88
parent2d2ceb99751da2ab3696c07bf419b0ab2f7c751d (diff)
downloadydb-c8ffbe2351c35a80d804fc0380e223f0196d0b67.tar.gz
Avoiding unnecessary copying (#2413)
-rw-r--r--ydb/core/persqueue/partition.cpp6
-rw-r--r--ydb/core/persqueue/partition.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/ydb/core/persqueue/partition.cpp b/ydb/core/persqueue/partition.cpp
index a27dac6d9b..24ebe69b2e 100644
--- a/ydb/core/persqueue/partition.cpp
+++ b/ydb/core/persqueue/partition.cpp
@@ -1832,7 +1832,7 @@ void TPartition::OnProcessTxsAndUserActsWriteComplete(ui64 cookie, const TActorC
Y_ABORT_UNLESS(cookie == SET_OFFSET_COOKIE);
if (ChangeConfig) {
- EndChangePartitionConfig(ChangeConfig->Config,
+ EndChangePartitionConfig(std::move(ChangeConfig->Config),
ChangeConfig->TopicConverter,
ctx);
}
@@ -1906,11 +1906,11 @@ void TPartition::OnProcessTxsAndUserActsWriteComplete(ui64 cookie, const TActorC
}
}
-void TPartition::EndChangePartitionConfig(const NKikimrPQ::TPQTabletConfig& config,
+void TPartition::EndChangePartitionConfig(NKikimrPQ::TPQTabletConfig&& config,
NPersQueue::TTopicConverterPtr topicConverter,
const TActorContext& ctx)
{
- Config = config;
+ Config = std::move(config);
PartitionConfig = GetPartitionConfig(Config);
PartitionGraph = MakePartitionGraph(Config);
TopicConverter = topicConverter;
diff --git a/ydb/core/persqueue/partition.h b/ydb/core/persqueue/partition.h
index dd12f65022..344a35b3c7 100644
--- a/ydb/core/persqueue/partition.h
+++ b/ydb/core/persqueue/partition.h
@@ -318,7 +318,7 @@ private:
void BeginChangePartitionConfig(const NKikimrPQ::TPQTabletConfig& config,
const TActorContext& ctx);
void OnProcessTxsAndUserActsWriteComplete(ui64 cookie, const TActorContext& ctx);
- void EndChangePartitionConfig(const NKikimrPQ::TPQTabletConfig& config,
+ void EndChangePartitionConfig(NKikimrPQ::TPQTabletConfig&& config,
NPersQueue::TTopicConverterPtr topicConverter,
const TActorContext& ctx);
TString GetKeyConfig() const;