405237 {
405238 D_ASSERT(idx < collection.count_in_segment);
405239 auto type = collection.container_type[idx++];
405240 const bool is_inverted = (type & 1) == 1;
405241 const bool is_run = ((type >> 1) & 1) == 1;
405243 if (is_run) {
405244 amount = collection.number_of_runs[run_idx++];
405245 } else {
405246 amount = collection.cardinality[array_idx++];
405247 }
405248 if (is_run) {
405249 return ContainerMetadata::RunContainer(amount);
405250 }
405251 if (amount == BITSET_CONTAINER_SENTINEL_VALUE) {
405252 return ContainerMetadata::BitsetContainer(amount);
405253 }
405254 return ContainerMetadata::ArrayContainer(amount, is_inverted);
405255}