summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/smallvec_type.hpp8
-rw-r--r--src/script/squirrel_helper.hpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp
index e71edf89f..f43265ebe 100644
--- a/src/core/smallvec_type.hpp
+++ b/src/core/smallvec_type.hpp
@@ -91,8 +91,8 @@ public:
*/
inline void Clear()
{
- for (uint i = 0; i < std::vector<T>::size(); i++) {
- free(std::vector<T>::operator[](i));
+ for (T p : *this) {
+ free(p);
}
std::vector<T>::clear();
@@ -121,8 +121,8 @@ public:
*/
inline void Clear()
{
- for (uint i = 0; i < std::vector<T>::size(); i++) {
- delete std::vector<T>::operator[](i);
+ for (T p : *this) {
+ delete p;
}
std::vector<T>::clear();
diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp
index add6b49c1..10f04f945 100644
--- a/src/script/squirrel_helper.hpp
+++ b/src/script/squirrel_helper.hpp
@@ -32,7 +32,7 @@ namespace SQConvert {
struct SQAutoFreePointers : std::vector<void *> {
~SQAutoFreePointers()
{
- for (uint i = 0; i < std::vector<void *>::size(); i++) free(std::vector<void *>::operator[](i));
+ for (void * p : *this) free(p);
}
};