Skip to content

Commit f5dbdf6

Browse files
TysonMNmoodmosaic
authored andcommitted
simplified use of plus/minus one
1 parent 65cf3a8 commit f5dbdf6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Hedgehog/Shrink.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ module Shrink =
102102
let one = LanguagePrimitives.GenericOne
103103
let rec binarySearchTree (destination : ^a) (x : ^a) =
104104
let xs =
105-
towards destination x
106-
|> Seq.cons (destination - one)
105+
towards (destination + one) x
106+
|> Seq.cons destination
107107
|> Seq.pairwise
108-
|> Seq.map (fun (d, x) -> binarySearchTree (d + one) x)
108+
|> Seq.map (fun (d, x) -> binarySearchTree d x)
109109
Node (x, xs)
110110
if destination = x then
111111
Node (x, Seq.empty)
112112
else
113-
binarySearchTree (destination + one) x
113+
binarySearchTree destination x
114114
|> Tree.addChildValue destination

0 commit comments

Comments
 (0)