summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmWIXPatchParser.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-05-04 14:12:45 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-04 15:17:49 (GMT)
commit3e027d9def0f2d9f542cb71eda12e9527c418c9e (patch)
tree5e1baea6d8eb68854e5ff0f13729b23a2fffdff4 /Source/CPack/WiX/cmWIXPatchParser.h
parentec526768ac5f1e00a39075cd07fd93cffa1f1818 (diff)
downloadCMake-3e027d9def0f2d9f542cb71eda12e9527c418c9e.zip
CMake-3e027d9def0f2d9f542cb71eda12e9527c418c9e.tar.gz
CMake-3e027d9def0f2d9f542cb71eda12e9527c418c9e.tar.bz2
c++: prefer vectors over lists
None of these usages of `std::list` were inserting or removing elements in the middle of the structure, so there were no benefits to using it. Other uses were related to C pointers being stable in a list of strings whereas in a vector of strings, small pointer optimizations could be moved and become invalid after a modification to the hosting vector. None of these uses modified the vector after handing out a C string to an external store.
Diffstat (limited to 'Source/CPack/WiX/cmWIXPatchParser.h')
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h
index c0c96cd..52c7e35 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.h
+++ b/Source/CPack/WiX/cmWIXPatchParser.h
@@ -7,8 +7,8 @@
#include "cmXMLParser.h"
-#include <list>
#include <map>
+#include <vector>
struct cmWIXPatchNode
{
@@ -36,7 +36,7 @@ struct cmWIXPatchElement : cmWIXPatchNode
~cmWIXPatchElement();
- typedef std::list<cmWIXPatchNode*> child_list_t;
+ typedef std::vector<cmWIXPatchNode*> child_list_t;
typedef std::map<std::string, std::string> attributes_t;
std::string name;
@@ -84,7 +84,7 @@ private:
fragment_map_t& Fragments;
- std::list<cmWIXPatchElement*> ElementStack;
+ std::vector<cmWIXPatchElement*> ElementStack;
};
#endif