MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / InsertBucketFor

Method InsertBucketFor

source/enum_set.h:423–434  ·  view source on GitHub ↗

Creates a new bucket to store `value` and inserts it at `index`. If the `index` is past the end, the bucket is inserted at the end of the vector.

Source from the content-addressed store, hash-verified

421 // If the `index` is past the end, the bucket is inserted at the end of the
422 // vector.
423 void InsertBucketFor(size_t index, T value) {
424 const T bucket_start = ComputeBucketStart(value);
425 Bucket bucket = {1ULL << ComputeBucketOffset(value), bucket_start};
426 auto it = buckets_.emplace(buckets_.begin() + index, std::move(bucket));
427#if defined(NDEBUG)
428 (void)it; // Silencing unused variable warning.
429#else
430 assert(std::next(it) == buckets_.end() ||
431 std::next(it)->start > bucket_start);
432 assert(it == buckets_.begin() || std::prev(it)->start < bucket_start);
433#endif
434 }
435
436 // Returns true if the bucket at `bucketIndex/ stores the enum at
437 // `bucketOffset`, false otherwise.

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected