From cd5747a15cefb70211f286dafbdc399b901a64cc Mon Sep 17 00:00:00 2001 From: Jan Van Bruggen Date: Thu, 29 Sep 2022 22:04:23 -0600 Subject: [PATCH] Run formatter even though it makes `matchesAtHelp` uglier Signed-off-by: Jan Van Bruggen --- crates/compiler/builtins/roc/Str.roc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/compiler/builtins/roc/Str.roc b/crates/compiler/builtins/roc/Str.roc index 21309e8ab0..fd8d3fcc30 100644 --- a/crates/compiler/builtins/roc/Str.roc +++ b/crates/compiler/builtins/roc/Str.roc @@ -459,8 +459,10 @@ matchesAt = \haystack, haystackIndex, needle -> matchesAtHelp = \state -> { haystack, haystackIndex, needle, needleIndex, needleLength, endIndex } = state isAtEndOfHaystack = haystackIndex >= endIndex + if isAtEndOfHaystack then didWalkEntireNeedle = needleIndex == needleLength + didWalkEntireNeedle else doesThisMatch = @@ -473,6 +475,7 @@ matchesAtHelp = \state -> haystackIndex: haystackIndex + 1, needleIndex: needleIndex + 1, } + doesThisMatch && doesRestMatch ## Walks over the string's UTF-8 bytes, calling a function which updates a state using each