Changeset 5131 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Aug 26, 2005, 11:18:24 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/list.h
r5120 r5131 382 382 inline T* tIterator<T>::firstElement () 383 383 { 384 this->currentEl = this->list->first; 385 if (this->currentEl != NULL) 386 return this->currentEl->curr; 384 this->tmpEl = this->list->first; 385 if (this->tmpEl != NULL) 386 { 387 this->currentEl = this->tmpEl->next; 388 return this->tmpEl->curr; 389 } 387 390 else 388 391 return NULL; … … 392 395 inline T* tIterator<T>::lastElement () 393 396 { 394 this->currentEl = this->list->last; 395 if (this->currentEl != NULL) 396 return this->currentEl->curr; 397 this->tmpEl = this->list->last; 398 if (this->tmpEl != NULL) 399 { 400 this->currentEl = tmpEl->prev; 401 return this->tmpEl->curr; 402 } 397 403 else 398 404 return NULL; … … 410 416 return NULL; 411 417 418 this->tmpEl = this->currentEl; 412 419 this->currentEl = this->currentEl->next; 413 if (this->currentEl != NULL) 414 return this->currentEl->curr; 415 else 416 return NULL; 420 421 return this->tmpEl->curr; 417 422 } 418 423 … … 427 432 return NULL; 428 433 434 this->tmpEl = this->currentEl; 429 435 this->currentEl = this->currentEl->prev; 430 if (this->currentEl != NULL) 431 return this->currentEl->curr; 432 else 433 return NULL; 436 437 return this->tmpEl->curr; 434 438 } 435 439
Note: See TracChangeset
for help on using the changeset viewer.