| 149 | /************************************************************************/ |
| 150 | |
| 151 | static void CPLHashSetClearInternal(CPLHashSet *set, bool bFinalize) |
| 152 | { |
| 153 | CPLAssert(set != nullptr); |
| 154 | for (int i = 0; i < set->nAllocatedSize; i++) |
| 155 | { |
| 156 | CPLList *cur = set->tabList[i]; |
| 157 | while (cur) |
| 158 | { |
| 159 | if (set->fnFreeEltFunc) |
| 160 | set->fnFreeEltFunc(cur->pData); |
| 161 | CPLList *psNext = cur->psNext; |
| 162 | if (bFinalize) |
| 163 | CPLFree(cur); |
| 164 | else |
| 165 | CPLHashSetReturnListElt(set, cur); |
| 166 | cur = psNext; |
| 167 | } |
| 168 | set->tabList[i] = nullptr; |
| 169 | } |
| 170 | set->bRehash = false; |
| 171 | } |
| 172 | |
| 173 | /************************************************************************/ |
| 174 | /* CPLHashSetDestroy() */ |
no test coverage detected