File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,13 +380,13 @@ atIndicesStable indexes (BoxedColumn column) =
380380 BoxedColumn $
381381 VB. generate
382382 (VU. length indexes)
383- (\ i -> column `VB.unsafeIndex` (indexes `VU.unsafeIndex` i ))
383+ (( column `VB.unsafeIndex` ) . (indexes `VU.unsafeIndex` ))
384384atIndicesStable indexes (UnboxedColumn column) = UnboxedColumn $ VU. unsafeBackpermute column indexes
385385atIndicesStable indexes (OptionalColumn column) =
386386 OptionalColumn $
387387 VB. generate
388388 (VU. length indexes)
389- (\ i -> column `VB.unsafeIndex` (indexes `VU.unsafeIndex` i ))
389+ (( column `VB.unsafeIndex` ) . (indexes `VU.unsafeIndex` ))
390390{-# INLINE atIndicesStable #-}
391391
392392{- | Like 'atIndicesStable' but treats negative indices as null,
Original file line number Diff line number Diff line change @@ -213,15 +213,21 @@ input — the sort happens once, not per-group.
213213sliceGroups :: Column -> VU. Vector Int -> VU. Vector Int -> V. Vector Column
214214sliceGroups col os indices = case col of
215215 BoxedColumn vec ->
216- let ! sorted = V. unsafeBackpermute vec (V. convert indices)
216+ let ! sorted =
217+ V. generate
218+ (VU. length indices)
219+ ((vec `V.unsafeIndex` ) . (indices `VU.unsafeIndex` ))
217220 in V. generate nGroups $ \ i ->
218221 BoxedColumn (V. unsafeSlice (start i) (len i) sorted)
219222 UnboxedColumn vec ->
220223 let ! sorted = VU. unsafeBackpermute vec indices
221224 in V. generate nGroups $ \ i ->
222225 UnboxedColumn (VU. unsafeSlice (start i) (len i) sorted)
223226 OptionalColumn vec ->
224- let ! sorted = V. unsafeBackpermute vec (V. convert indices)
227+ let ! sorted =
228+ V. generate
229+ (VU. length indices)
230+ ((vec `V.unsafeIndex` ) . (indices `VU.unsafeIndex` ))
225231 in V. generate nGroups $ \ i ->
226232 OptionalColumn (V. unsafeSlice (start i) (len i) sorted)
227233 where
You can’t perform that action at this time.
0 commit comments