mirror of https://github.com/qt/qtgrpc.git
Avoid comparing streams by value
Comparing steams by value shouldn't happen, it's artifact that left from the stream reuse mechanism. Pick-to: 6.5 Change-Id: Ib9c5ee3e616d1a0bc75853a87ab15461dbf76f91 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
This commit is contained in:
parent
8f4ec7436c
commit
d2d8f0915c
|
|
@ -211,11 +211,9 @@ std::shared_ptr<QGrpcStream> QAbstractGrpcClient::startStream(QLatin1StringView
|
||||||
Q_D(QAbstractGrpcClient);
|
Q_D(QAbstractGrpcClient);
|
||||||
qGrpcWarning()
|
qGrpcWarning()
|
||||||
<< grpcStream->method() << "call" << d->service << "stream finished.";
|
<< grpcStream->method() << "call" << d->service << "stream finished.";
|
||||||
auto it = std::find_if(d->activeStreams.begin(), d->activeStreams.end(),
|
|
||||||
[grpcStream](std::shared_ptr<QGrpcStream> activeStream) {
|
|
||||||
return *activeStream == *grpcStream;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
auto it =
|
||||||
|
std::find(d->activeStreams.begin(), d->activeStreams.end(), grpcStream);
|
||||||
if (it != d->activeStreams.end())
|
if (it != d->activeStreams.end())
|
||||||
d->activeStreams.erase(it);
|
d->activeStreams.erase(it);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@ public:
|
||||||
QByteArrayView arg() const;
|
QByteArrayView arg() const;
|
||||||
void updateData(const QByteArray &data);
|
void updateData(const QByteArray &data);
|
||||||
|
|
||||||
bool operator==(const QGrpcStream &other) const
|
|
||||||
{
|
|
||||||
return other.method() == method() && other.arg() == arg();
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void messageReceived();
|
void messageReceived();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue