MCPcopy Create free account
hub / github.com/defold/defold / UpdateVisited

Function UpdateVisited

engine/resource/src/resource_mounts.cpp:428–446  ·  view source on GitHub ↗

Returns true if existed. Returns false if it didn't exist. Also adds to the set

Source from the content-addressed store, hash-verified

426// Returns true if existed.
427// Returns false if it didn't exist. Also adds to the set
428static bool UpdateVisited(dmHashTable64<bool>& t, dmhash_t url_hash, bool exists)
429{
430 bool* visited = t.Get(url_hash);
431 if (visited)
432 {
433 *visited = exists;
434 return true;
435 }
436
437 if (t.Full())
438 {
439 uint32_t capacity = t.Capacity();
440 capacity += 32;
441 uint32_t table_size = (capacity*2)/3;
442 t.SetCapacity(table_size, capacity);
443 }
444 t.Put(url_hash, exists);
445 return exists; // it didn't exist
446}
447
448static dmResource::Result GetDependenciesInternal(DependencyIterContext* ctx, const dmhash_t url_hash)
449{

Callers 1

GetDependenciesInternalFunction · 0.85

Calls 5

GetMethod · 0.45
FullMethod · 0.45
CapacityMethod · 0.45
SetCapacityMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected