summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2024-04-02 14:51:17 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2024-04-04 14:55:40 +0200
commiteadebf81ce5e6d641b95f58be6f2cfe6dfd4fc90 (patch)
treef48ed13070fa98f4c2f978d28d7a6c33b0317b72
parent847179209997537d9af032aee7f9d3389e3be05c (diff)
Return const ref to QGrpcMetadata in QGrpcOperation::metadata
Avoid redundant copies. Task-number: QTBUG-123625 Change-Id: I0637b302a78c629badb2741e8e620674ef2d3b0d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r--src/grpc/qgrpcoperation.cpp2
-rw-r--r--src/grpc/qgrpcoperation.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/grpc/qgrpcoperation.cpp b/src/grpc/qgrpcoperation.cpp
index 51a663d..f12aa74 100644
--- a/src/grpc/qgrpcoperation.cpp
+++ b/src/grpc/qgrpcoperation.cpp
@@ -136,7 +136,7 @@ void QGrpcOperation::read(QProtobufMessage *message) const
Getter of the metadata received from the channel. For the HTTP2 channels it
usually contains the HTTP headers received from the server.
*/
-QGrpcMetadata QGrpcOperation::metadata() const noexcept
+const QGrpcMetadata &QGrpcOperation::metadata() const noexcept
{
return d_func()->channelOperation->serverMetadata();
}
diff --git a/src/grpc/qgrpcoperation.h b/src/grpc/qgrpcoperation.h
index d9cc9f6..4f3e7df 100644
--- a/src/grpc/qgrpcoperation.h
+++ b/src/grpc/qgrpcoperation.h
@@ -36,7 +36,7 @@ public:
void read(QProtobufMessage *message) const;
- [[nodiscard]] QGrpcMetadata metadata() const noexcept;
+ [[nodiscard]] const QGrpcMetadata &metadata() const noexcept;
[[nodiscard]] QLatin1StringView method() const noexcept;
void cancel();