summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-09-14 23:03:28 +0000
committertruelight <truelight@openttd.org>2007-09-14 23:03:28 +0000
commitf438dcdd67f5f3654a2ef937bfa7af4ff762966c (patch)
treed0590d36995a3ef4c719803d36944bf3b9ce9441 /src
parente8ff9ee98224ba8d5c88359dc5f1059abaffdd37 (diff)
downloadopenttd-f438dcdd67f5f3654a2ef937bfa7af4ff762966c.tar.xz
(svn r11109) -Fix r11106: it is silly to use a std::list for something that is cleary a std::vector (less memory ;) WHOHO!)
Diffstat (limited to 'src')
-rw-r--r--src/fileio.cpp2
-rw-r--r--src/fileio.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index f4d7e847f..c1542f81e 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -204,7 +204,7 @@ const char *_subdirs[NUM_SUBDIRS] = {
};
const char *_searchpaths[NUM_SEARCHPATHS];
-std::list<const char *> _tar_list;
+std::vector<const char *> _tar_list;
/**
* Check whether the given file exists
diff --git a/src/fileio.h b/src/fileio.h
index 426226399..a6556def4 100644
--- a/src/fileio.h
+++ b/src/fileio.h
@@ -6,7 +6,7 @@
#define FILEIO_H
#include "helpers.hpp"
-#include <list>
+#include <vector>
void FioSeekTo(uint32 pos, int mode);
void FioSeekToFile(uint8 slot, uint32 pos);
@@ -64,7 +64,7 @@ extern const char *_searchpaths[NUM_SEARCHPATHS];
/**
* All the tar-files OpenTTD could search through.
*/
-extern std::list<const char *>_tar_list;
+extern std::vector<const char *>_tar_list;
/**
* Checks whether the given search path is a valid search path
@@ -78,7 +78,7 @@ static inline bool IsValidSearchPath(Searchpath sp)
/** Iterator for all the search paths */
#define FOR_ALL_SEARCHPATHS(sp) for (sp = SP_FIRST_DIR; sp < NUM_SEARCHPATHS; sp++) if (IsValidSearchPath(sp))
-#define FOR_ALL_TARS(tar) for (std::list<const char *>::iterator it = _tar_list.begin(); it != _tar_list.end(); it++) if (tar = *it, true)
+#define FOR_ALL_TARS(tar) for (std::vector<const char *>::iterator it = _tar_list.begin(); it != _tar_list.end(); it++) if (tar = *it, true)
typedef bool FioTarFileListCallback(const char *filename, int size, void *userdata);
FILE *FioTarFileList(const char *tar, const char *mode, size_t *filesize, FioTarFileListCallback *callback, void *userdata);