Skip to content

Commit 177e09d

Browse files
committed
remove short-circuiting logic
1 parent 0533f7c commit 177e09d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/stdlib_strings.fypp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,12 @@ contains
303303
last = len(string)
304304
nsub = len(substring)
305305
if (nsub > 0 .and. nsub <= last) then
306-
do while(last >= nsub .and. string(last-nsub+1:last) == substring)
307-
last = last - nsub
306+
do while(last >= nsub)
307+
if (string(last-nsub+1:last) == substring) then
308+
last = last - nsub
309+
else
310+
exit
311+
end if
308312
end do
309313
end if
310314

0 commit comments

Comments
 (0)