summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestSVN.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-05-04 10:12:45 -0400
committerBrad King <brad.king@kitware.com>2017-05-04 11:17:49 -0400
commit3e027d9def0f2d9f542cb71eda12e9527c418c9e (patch)
tree5e1baea6d8eb68854e5ff0f13729b23a2fffdff4 /Source/CTest/cmCTestSVN.cxx
parentec526768ac5f1e00a39075cd07fd93cffa1f1818 (diff)
downloadcmake-3e027d9def0f2d9f542cb71eda12e9527c418c9e.tar.gz
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/CTest/cmCTestSVN.cxx')
-rw-r--r--Source/CTest/cmCTestSVN.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 0b872815f2..f60f78c211 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -103,8 +103,8 @@ bool cmCTestSVN::NoteOldRevision()
return false;
}
- std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
- std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ std::vector<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::vector<SVNInfo>::iterator itend = this->Repositories.end();
for (; itbeg != itend; itbeg++) {
SVNInfo& svninfo = *itbeg;
svninfo.OldRevision = this->LoadInfo(svninfo);
@@ -127,8 +127,8 @@ bool cmCTestSVN::NoteNewRevision()
return false;
}
- std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
- std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ std::vector<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::vector<SVNInfo>::iterator itend = this->Repositories.end();
for (; itbeg != itend; itbeg++) {
SVNInfo& svninfo = *itbeg;
svninfo.NewRevision = this->LoadInfo(svninfo);
@@ -380,8 +380,8 @@ bool cmCTestSVN::LoadRevisions()
{
bool result = true;
// Get revisions for all the external repositories
- std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
- std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ std::vector<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::vector<SVNInfo>::iterator itend = this->Repositories.end();
for (; itbeg != itend; itbeg++) {
SVNInfo& svninfo = *itbeg;
result = this->LoadRevisions(svninfo) && result;