From 0736e813c103a70ba920cd9157cbcecc3725d5e2 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 31 Oct 2024 17:14:03 -0400 Subject: [PATCH] Fixed boneheaded mistake with checking assertion types --- nfa.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nfa.go b/nfa.go index add1ec6..9cfb98b 100644 --- a/nfa.go +++ b/nfa.go @@ -34,12 +34,10 @@ func (s State) contentContains(str []rune, idx int) bool { return idx == len(str) } if s.assert == WBOUND { - if s.assert == WBOUND { - return isWordBoundary(str, idx) - } - if s.assert == NONWBOUND { - return !isWordBoundary(str, idx) - } + return isWordBoundary(str, idx) + } + if s.assert == NONWBOUND { + return !isWordBoundary(str, idx) } // Default - s.assert must be NONE return slices.Contains(s.content, int(str[idx]))