| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #ifndef __LIST_INDEX_UTILS_IMPL_H__ | ||
| 8 | #define __LIST_INDEX_UTILS_IMPL_H__ | ||
| 9 | |||
| 10 | #include "list_index_utils.h" | ||
| 11 | |||
| 12 | ///Remove index from listIndex | ||
| 13 | /** @param[out] listIndex : list of index to be modified | ||
| 14 | * @param index : index to be removed from list of index | ||
| 15 | */ | ||
| 16 | template<typename UIdx> | ||
| 17 | 4 | void listindex_remove(std::list<UIdx> & listIndex, UIdx index){ | |
| 18 |
1/2✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 4 times.
|
4 | if(listIndex.size() == 0lu){return;} |
| 19 | 4 | typename std::list<UIdx>::iterator it(listIndex.begin()); | |
| 20 |
2/2✓ Branch 0 (16→7) taken 10 times.
✓ Branch 1 (16→17) taken 4 times.
|
14 | while(it != listIndex.end()){ |
| 21 |
2/2✓ Branch 0 (8→9) taken 4 times.
✓ Branch 1 (8→12) taken 6 times.
|
10 | if(*it == index){ |
| 22 | 4 | it = listIndex.erase(it); | |
| 23 | }else{ | ||
| 24 | 6 | ++it; | |
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | #endif | ||
| 30 | |||
| 31 | |||
| 32 |