MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLHashSetClearInternal

Function CPLHashSetClearInternal

port/cpl_hash_set.cpp:151–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149/************************************************************************/
150
151static 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() */

Callers 2

CPLHashSetDestroyFunction · 0.85
CPLHashSetClearFunction · 0.85

Calls 1

CPLHashSetReturnListEltFunction · 0.85

Tested by

no test coverage detected