Rev 720 | Rev 738 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 720 | Rev 734 | ||
---|---|---|---|
Line 156... | Line 156... | ||
156 | mTrees.append(Tree()); |
156 | mTrees.append(Tree()); |
157 | return mTrees.back(); |
157 | return mTrees.back(); |
158 | }
|
158 | }
|
159 | int ResourceUnit::newTreeIndex() |
159 | int ResourceUnit::newTreeIndex() |
160 | {
|
160 | {
|
161 | // start simple: just append to the vector...
|
- | |
162 | mTrees.append(Tree()); |
- | |
163 | return mTrees.count()-1; |
- | |
- | 161 | newTree(); |
|
- | 162 | return mTrees.count()-1; // return index of the last tree |
|
164 | }
|
163 | }
|
165 | 164 | ||
166 | /// remove dead trees from tree list
|
165 | /// remove dead trees from tree list
|
167 | /// reduce size of vector if lots of space is free
|
166 | /// reduce size of vector if lots of space is free
|
168 | /// tests showed that this way of cleanup is very fast,
|
167 | /// tests showed that this way of cleanup is very fast,
|