MCPcopy Create free account
hub / github.com/bytedance/bolt / fillInIndices

Method fillInIndices

bolt/vector/DecodedVector.cpp:244–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void DecodedVector::fillInIndices() {
245 if (isConstantMapping_) {
246 if (size_ > zeroIndices().size() || constantIndex_ != 0) {
247 copiedIndices_.resize(size_);
248 std::fill(copiedIndices_.begin(), copiedIndices_.end(), constantIndex_);
249 indices_ = copiedIndices_.data();
250 } else {
251 indices_ = zeroIndices().data();
252 }
253 return;
254 }
255 if (isIdentityMapping_) {
256 if (size_ > consecutiveIndices().size()) {
257 copiedIndices_.resize(size_);
258 std::iota(copiedIndices_.begin(), copiedIndices_.end(), 0);
259 indices_ = &copiedIndices_[0];
260 } else {
261 indices_ = consecutiveIndices().data();
262 }
263 return;
264 }
265 BOLT_FAIL(
266 "DecodedVector::indices_ must be set for non-constant non-consecutive mapping.");
267}
268
269void DecodedVector::makeIndicesMutable() {
270 if (indicesNotCopied()) {

Callers

nothing calls this directly

Calls 6

iotaFunction · 0.50
sizeMethod · 0.45
resizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected