diff options
author | FWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2011-12-08 17:03:29 +0000 |
---|---|---|
committer | FWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2011-12-08 17:03:29 +0000 |
commit | dce7ccf394831c73adccd72ed94321652362ca2e (patch) | |
tree | f6ea99f970fb7711a51967c488e3cc909301872d /FoundationEx/List.inl | |
parent | 8c6737e70cb6ac4ae1cb0505ba8c81c32e867897 (diff) | |
download | starshatter-dce7ccf394831c73adccd72ed94321652362ca2e.zip starshatter-dce7ccf394831c73adccd72ed94321652362ca2e.tar.gz starshatter-dce7ccf394831c73adccd72ed94321652362ca2e.tar.bz2 |
Variable scoping fixes
Diffstat (limited to 'FoundationEx/List.inl')
-rw-r--r-- | FoundationEx/List.inl | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/FoundationEx/List.inl b/FoundationEx/List.inl index 841e690..d868e65 100644 --- a/FoundationEx/List.inl +++ b/FoundationEx/List.inl @@ -130,8 +130,8 @@ void List<T>::resize(int newsize) #else
T** v = new PTR[extent];
#endif
-
- for (int i = 0; i < items; i++)
+ int i;
+ for (i = 0; i < items; i++)
v[i] = array[i];
for (; i < extent; i++)
@@ -187,14 +187,15 @@ void List<T>::insert(const T* item, int index) template <class T>
void List<T>::insertSort(const T* item)
{
- if (item) {
- for (int i = 0; i < items; i++) {
- if (*item < *array[i])
- break;
- }
-
- insert(item, i);
- }
+ if (item) {
+ int i;
+ for (i = 0; i < items; i++) {
+ if (*item < *array[i])
+ break;
+ }
+
+ insert(item, i);
+ }
}
// +-------------------------------------------------------------------+
|