1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Performance improvement: Use std::list instead of std::vector for request_media, Server::getModNames, Environment::m_simple_objects.

* Also remove unused Server::m_modspaths
This commit is contained in:
Loic Blot 2015-03-05 10:43:08 +01:00
parent b214cde5b4
commit 365e4ae0fa
8 changed files with 16 additions and 21 deletions

View file

@ -778,7 +778,7 @@ void Client::deletingPeer(con::Peer *peer, bool timeout)
string name
}
*/
void Client::request_media(const std::list<std::string> &file_requests)
void Client::request_media(const std::vector<std::string> &file_requests)
{
std::ostringstream os(std::ios_base::binary);
writeU16(os, TOSERVER_REQUEST_MEDIA);
@ -790,7 +790,7 @@ void Client::request_media(const std::list<std::string> &file_requests)
*pkt << (u16) (file_requests_size & 0xFFFF);
for(std::list<std::string>::const_iterator i = file_requests.begin();
for(std::vector<std::string>::const_iterator i = file_requests.begin();
i != file_requests.end(); ++i) {
*pkt << (*i);
}