Skip to content

Commit

Permalink
unrolled exact length loops. Seems to have helped somewhat with perfo…
Browse files Browse the repository at this point in the history
…rmance
  • Loading branch information
jmeaster30 committed Mar 25, 2023
1 parent 7b22eae commit ffee0d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions docs/examples/frankenstein/bigwords.vore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
find all
at least 8 letter
find all word start at least 8 letter word end
2 changes: 2 additions & 0 deletions docs/examples/frankenstein/specificSizedWords.vore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
find all word start exactly 8 letter word end
--find all word start letter letter letter letter letter letter letter letter word end
8 changes: 8 additions & 0 deletions libvore/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ func (l *AstLoop) generate(offset int, state *GenState) ([]SearchInstruction, er
return []SearchInstruction{}, gen_error
}

if l.min == l.max {
result := []SearchInstruction{}
for i := 0; i < l.max; i++ {
result = append(result, body...)
}
return result, nil
}

id := rand.Int63()

start := StartLoop{
Expand Down

0 comments on commit ffee0d0

Please sign in to comment.