Skip to content

Commit

Permalink
fix: splitAtD reverse bug from #919
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 committed Aug 16, 2024
1 parent f2c939c commit f7aebca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Batteries/Data/List/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def splitAtD (n : Nat) (l : List α) (dflt : α) : List α × List α := go n l
if `splitAtD n l dflt = (left, right)`. -/
go : Nat → List α → List α → List α × List α
| n+1, x :: xs, acc => go n xs (x :: acc)
| 0, xs, acc => (acc, xs)
| 0, xs, acc => (acc.reverse, xs)
| n, [], acc => (acc.reverseAux (replicate n dflt), [])

/--
Expand Down

0 comments on commit f7aebca

Please sign in to comment.