Skip to content

Commit 76182e2

Browse files
committed
optimised find function for consider_overlapping is .true.
1 parent f449f26 commit 76182e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stdlib_strings.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,10 @@ pure function find_char_char(string, pattern, occurrence, consider_overlapping)
450450
res = s_i - length_pattern + 1
451451
exit
452452
else if (consider_overlapping_) then
453-
s_i = s_i - length_pattern + 1
453+
p_i = lps_array(p_i)
454+
else
455+
p_i = 0
454456
end if
455-
p_i = 0
456457
end if
457458
s_i = s_i + 1
458459
p_i = p_i + 1

0 commit comments

Comments
 (0)