Browse Source

Fixed DataChannel::peek() clearing the peeked message by moving it

Paul-Louis Ageneau 2 năm trước cách đây
mục cha
commit
ca795c2a02
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/impl/datachannel.cpp

+ 1 - 1
src/impl/datachannel.cpp

@@ -114,7 +114,7 @@ optional<message_variant> DataChannel::receive() {
 
 optional<message_variant> DataChannel::peek() {
 	auto next = mRecvQueue.peek();
-	return next ? std::make_optional(to_variant(std::move(**next))) : nullopt;
+	return next ? std::make_optional(to_variant(**next)) : nullopt;
 }
 
 size_t DataChannel::availableAmount() const { return mRecvQueue.amount(); }