flaw-visual/Flaw/Visual/Geometry/Simplification.hs

Summary

Maintainability
Test Coverage

Use forM_
Open

          accountForPair a b = case M.lookup (PairKey a b) pairHeapIndexByKey of
            Just h -> VGM.unsafeModify pairTriangleCounts (+ 1) h
            Nothing -> return ()

Found

case M.lookup (PairKey a b) pairHeapIndexByKey of
    Just h -> VGM.unsafeModify pairTriangleCounts (+ 1) h
    Nothing -> return ()

Perhaps

Data.Foldable.forM_ (M.lookup (PairKey a b) pairHeapIndexByKey)
  (VGM.unsafeModify pairTriangleCounts (+ 1))

Use when
Open

      else if pair_cost rp < pair_cost p && pair_cost rp <= pair_cost lp then swap r rp
      else return ()

Found

if pair_cost rp < pair_cost p && pair_cost rp <= pair_cost lp then
  swap r rp else return ()

Perhaps

when (pair_cost rp < pair_cost p && pair_cost rp <= pair_cost lp) $
  swap r rp

Reduce duplication
Open

        i1 = indices VG.! (i * 3)

Found

i1 = indices VG.! (i * 3)
i2 = indices VG.! (i * 3 + 1)
i3 = indices VG.! (i * 3 + 2)

Perhaps

Combine with flaw-visual/Flaw/Visual/Geometry/Simplification.hs:200:11

Reduce duplication
Open

      p <- VGM.unsafeRead pairHeap i

Found

p <- VGM.unsafeRead pairHeap i
let m = (i - 1) `quot` 2
mp <- VGM.unsafeRead pairHeap m

Perhaps

Combine with flaw-visual/Flaw/Visual/Geometry/Simplification.hs:327:9

There are no issues that match your filters.

Category
Status