Changeset 5262 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Sep 26, 2005, 11:33:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/array.h
r5100 r5262 15 15 16 16 /*! 17 \file array.h18 \brief Contains the Array Class that handles arrays of classes.17 @file array.h 18 @brief Contains the Array Class that handles arrays of classes. 19 19 this class creates a Array of a semi-Dynamic length. 20 20 beware, that after finalizing the array may not be resized again. … … 90 90 { 91 91 PRINTF(5)("deleting array\n"); 92 Entry* walker = this->firstEntry; 93 Entry* previous; 94 while (walker) 92 if (!this->finalized) 95 93 { 96 previous = walker; 97 walker = walker->next; 98 delete previous; 94 Entry* walker = this->firstEntry; 95 Entry* previous; 96 while (walker) 97 { 98 previous = walker; 99 walker = walker->next; 100 delete previous; 101 } 99 102 } 100 if ( finalized)103 if (this->finalized) 101 104 delete[] this->array; 102 105 } … … 109 112 void Array<T>::finalizeArray () 110 113 { 114 if (this->finalized) 115 return; 111 116 PRINTF(5)("Finalizing array. Length: %i\n", entryCount); 112 117 if (!(this->array = new T [this->entryCount])) 113 118 PRINTF(1)("could not allocate %i data Blocks\n", this->entryCount); 114 119 Entry* walker = this->firstEntry; 115 for (int i=0; i <this->entryCount; i++)120 for (int i=0; i < this->entryCount; i++) 116 121 { 117 122 this->array[i] = walker->value;
Note: See TracChangeset
for help on using the changeset viewer.