GCC Code Coverage Report


Directory: ./
File: src/list_index_utils_impl.h
Date: 2025-03-14 11:38:38
Exec Total Coverage
Lines: 7 7 100.0%
Branches: 5 6 83.3%

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 1 not taken.
✓ Branch 2 taken 4 times.
4 if(listIndex.size() == 0lu){return;}
19 4 typename std::list<UIdx>::iterator it(listIndex.begin());
20
2/2
✓ Branch 2 taken 10 times.
✓ Branch 3 taken 4 times.
14 while(it != listIndex.end()){
21
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 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