[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldmap path.hxx,1.2,1.3
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldmap path.hxx,1.2,1.3 |
Date: |
19 Oct 2002 17:43:09 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv5841
Modified Files:
path.hxx
Log Message:
replaced std::vector insert
Index: path.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/path.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- path.hxx 15 Oct 2002 21:48:43 -0000 1.2
+++ path.hxx 19 Oct 2002 17:43:07 -0000 1.3
@@ -20,6 +20,7 @@
#ifndef HEADER_PINGUS_WORLDMAP_PATH_HXX
#define HEADER_PINGUS_WORLDMAP_PATH_HXX
+#include <algorithm>
#include <vector>
#include "../vector.hxx"
@@ -69,12 +70,16 @@
void insert(Path& p) {
path_length_valid = false;
- vec.insert(vec.end(), p.vec.begin(), p.vec.end());
+ //vec.insert(vec.end(), p.vec.begin(), p.vec.end());
+ vec.reserve(vec.size() + p.vec.size ());
+ std::copy(p.vec.begin(), p.vec.end(), std::back_inserter(vec));
}
void reverse_insert(Path& p) {
path_length_valid = false;
- vec.insert(vec.end(), p.vec.rbegin(), p.vec.rend());
+ //vec.insert(vec.end(), p.vec.rbegin(), p.vec.rend());
+ vec.reserve(vec.size() + p.vec.size ());
+ std::copy(p.vec.rbegin(), p.vec.rend(), std::back_inserter(vec));
}
void reverse();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap path.hxx,1.2,1.3,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap dot.hxx,1.4,1.5 level_dot.cxx,1.4,1.5 level_dot.hxx,1.3,1.4 path.cxx,1.3,1.4 worldmap.cxx,1.23,1.24
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.19,1.20 blitter_impl.hxx,1.1,1.2
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap dot.hxx,1.4,1.5 level_dot.cxx,1.4,1.5 level_dot.hxx,1.3,1.4 path.cxx,1.3,1.4 worldmap.cxx,1.23,1.24
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.19,1.20 blitter_impl.hxx,1.1,1.2
- Index(es):