minor robustness fixes in repo cost reordering code

This commit is contained in:
Joey Hess 2013-03-18 13:13:33 -04:00
parent 705cb5a84a
commit 69cc8e83ce
2 changed files with 7 additions and 7 deletions

View file

@ -42,7 +42,7 @@ encryptedRemoteCostAdj = 50
- position longer than the list.
-}
insertCostAfter :: [Cost] -> Int -> [Cost]
insertCostAfter [] _ = error "insertCostAfter: empty list"
insertCostAfter [] _ = []
insertCostAfter l pos
| pos < 0 = costBetween 0 (l !! 0) : l
| nextpos > maxpos = l ++ [1 + l !! maxpos]