From 44e0fa73c0303fed5a8a3a8c6296748bdadd2920 Mon Sep 17 00:00:00 2001 From: neurlang <77860779+neurlang@users.noreply.github.com> Date: Sat, 22 Jun 2024 09:09:41 +0200 Subject: [PATCH] Update walk.go post decrement --- walk.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/walk.go b/walk.go index 5a8ca77..3deedfe 100644 --- a/walk.go +++ b/walk.go @@ -18,41 +18,41 @@ func WalkVals[T Number](mat []T, width uint, to func(prev T, this T, x uint, y u left := x - 1 + width*(y) if diag >= 0 { if mat[diag] < mat[left] && mat[diag] < mat[up] { - x-- - y-- if to(mat[here], mat[diag], x, y) { return } + x-- + y-- continue } } if left >= 0 && up >= 0 { if mat[up] < mat[left] { - y-- if to(mat[here], mat[up], x, y) { return } + y-- continue } else { - x-- if to(mat[here], mat[left], x, y) { return } + x-- continue } } if left >= 0 { - x-- if to(mat[here], mat[left], x, y) { return } + x-- continue } if up >= 0 { - y-- if to(mat[here], mat[up], x, y) { return } + y-- continue } }