@@ -104,7 +104,8 @@ void fillBaseInfo(BaseStreamInfo &dst, const std::string &stream_id,
104104// Reader implementation
105105// =====================================================================
106106
107- TextStreamReader::TextStreamReader (const TextStreamInfo &info) : info_(info) {}
107+ TextStreamReader::TextStreamReader (TextStreamInfo info)
108+ : info_(std::move(info)) {}
108109
109110void TextStreamReader::onChunkUpdate (const std::string &text) {
110111 {
@@ -148,7 +149,8 @@ std::string TextStreamReader::readAll() {
148149 return result;
149150}
150151
151- ByteStreamReader::ByteStreamReader (const ByteStreamInfo &info) : info_(info) {}
152+ ByteStreamReader::ByteStreamReader (ByteStreamInfo info)
153+ : info_(std::move(info)) {}
152154
153155void ByteStreamReader::onChunkUpdate (const std::vector<std::uint8_t > &bytes) {
154156 {
@@ -189,21 +191,22 @@ bool ByteStreamReader::readNext(std::vector<std::uint8_t> &out) {
189191// =====================================================================
190192
191193BaseStreamWriter::BaseStreamWriter (
192- LocalParticipant &local_participant, const std::string & topic,
193- const std::map<std::string, std::string> & attributes,
194- const std::string & stream_id, std::optional<std::size_t > total_size,
195- const std::string & mime_type,
196- const std::vector<std::string> & destination_identities,
197- const std::string & sender_identity)
194+ LocalParticipant &local_participant, std::string topic,
195+ std::map<std::string, std::string> attributes,
196+ std::string stream_id, std::optional<std::size_t > total_size,
197+ std::string mime_type,
198+ std::vector<std::string> destination_identities,
199+ std::string sender_identity)
198200 : local_participant_(local_participant),
199- stream_id_ (stream_id.empty() ? generateRandomId() : stream_id),
200- mime_type_(mime_type), topic_(topic),
201+ stream_id_ (stream_id.empty() ? generateRandomId()
202+ : std::move(stream_id)),
203+ mime_type_(std::move(mime_type)), topic_(std::move(topic)),
201204 timestamp_ms_(std::chrono::duration_cast<std::chrono::milliseconds>(
202205 std::chrono::system_clock::now ().time_since_epoch())
203206 .count()),
204- total_size_(total_size), attributes_(attributes),
205- destination_identities_(destination_identities),
206- sender_identity_(sender_identity) {
207+ total_size_(total_size), attributes_(std::move( attributes) ),
208+ destination_identities_(std::move( destination_identities) ),
209+ sender_identity_(std::move( sender_identity) ) {
207210 if (sender_identity_.empty ()) {
208211 sender_identity_ = local_participant_.identity ();
209212 }
0 commit comments