diff --git a/src/mol-model/structure/structure/element/bundle.ts b/src/mol-model/structure/structure/element/bundle.ts index b222894267daaf4f7958d1aceea3efb3728dd989..c8e53425bc695671832b5e9cb32eb2fae58ccd40 100644 --- a/src/mol-model/structure/structure/element/bundle.ts +++ b/src/mol-model/structure/structure/element/bundle.ts @@ -180,9 +180,10 @@ export namespace Bundle { SortedRanges.forEach(e.ranges, (v, i) => _indices[i] = unit.elements[v]) indices = SortedArray.ofSortedArray(_indices) } else { - const rangesSize = SortedRanges.size(e.ranges) SortedRanges.forEach(e.ranges, (v, i) => _indices[i] = unit.elements[v]) - SortedRanges.forEach(e.set, (v, i) => _indices[i + rangesSize] = unit.elements[v]) + for (let i = 0, il = e.set.length; i < il; ++i) { + _indices[i + rangesSize] = unit.elements[e.set[i]] + } indices = SortedArray.ofUnsortedArray(_indices) // requires sort }