fix: Local variable 'pex' will be copied despite being returned by name (#6300)

This commit is contained in:
Cœur 2023-11-26 18:27:40 +01:00 committed by GitHub
parent 089a697809
commit 98b3e819ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -388,7 +388,7 @@ private:
};
pex.erase(std::remove_if(std::begin(pex), std::end(pex), IsBadPex), std::end(pex));
return pex;
return std::move(pex);
}
static void callback(void* vself, int event, unsigned char const* info_hash, void const* data, size_t data_len)

View File

@ -143,7 +143,7 @@ public:
return { iter->second, false };
}
return { vec_.emplace_back(key, tr_variant{ std::move(val) }).second, true };
return { vec_.emplace_back(key, tr_variant{ std::forward<Val>(val) }).second, true };
}
// --- custom functions