mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use std::vector instead of std::list in StaticObjectList and MutexedMap::getValues()
This commit is contained in:
parent
06f328207f
commit
cd684497c2
5 changed files with 12 additions and 15 deletions
|
@ -47,10 +47,9 @@ void StaticObjectList::serialize(std::ostream &os)
|
|||
// count
|
||||
u16 count = m_stored.size() + m_active.size();
|
||||
writeU16(os, count);
|
||||
for(std::list<StaticObject>::iterator
|
||||
for(std::vector<StaticObject>::iterator
|
||||
i = m_stored.begin();
|
||||
i != m_stored.end(); ++i)
|
||||
{
|
||||
i != m_stored.end(); ++i) {
|
||||
StaticObject &s_obj = *i;
|
||||
s_obj.serialize(os);
|
||||
}
|
||||
|
@ -68,8 +67,7 @@ void StaticObjectList::deSerialize(std::istream &is)
|
|||
u8 version = readU8(is);
|
||||
// count
|
||||
u16 count = readU16(is);
|
||||
for(u16 i=0; i<count; i++)
|
||||
{
|
||||
for(u16 i = 0; i < count; i++) {
|
||||
StaticObject s_obj;
|
||||
s_obj.deSerialize(is, version);
|
||||
m_stored.push_back(s_obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue