1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 09:07:19 +02:00

Convert AnimationSet to unordered_map and use reserve

This commit is contained in:
Filip Gawin 2018-12-09 15:00:00 +01:00
parent 8c7e94a600
commit 4063fabe52
2 changed files with 4 additions and 2 deletions

View File

@ -1,8 +1,8 @@
#ifndef _LIBRW_RW_FORWARD_HPP_
#define _LIBRW_RW_FORWARD_HPP_
#include <map>
#include <memory>
#include <unordered_map>
#include <vector>
// Forward Declarations
@ -23,6 +23,6 @@ using ClumpPtr = std::shared_ptr<Clump>;
// Collections
using AtomicList = std::vector<AtomicPtr>;
typedef std::map<std::string, AnimationPtr> AnimationSet;
typedef std::unordered_map<std::string, AnimationPtr> AnimationSet;
#endif /* FORWARD_HPP */

View File

@ -63,6 +63,8 @@ bool LoaderIFP::loadFromMemory(char* data) {
ANPK* fileRoot = read<ANPK>(data, dataI);
std::string listname = readString(data, dataI);
animations.reserve(fileRoot->info.entries);
for (auto a = 0u; a < fileRoot->info.entries; ++a) {
// something about a name?
/*NAME* n =*/read<NAME>(data, dataI);