better logic

This commit is contained in:
Sharan Roongta 2020-09-25 04:52:03 +02:00
parent 0de54404ee
commit 21ff587e17
1 changed files with 5 additions and 9 deletions

View File

@ -238,18 +238,14 @@ subroutine skip_empty_lines(blck,s_blck)
character(len=:), allocatable :: line character(len=:), allocatable :: line
integer :: e_blck integer :: e_blck
logical :: not_empty logical :: empty
not_empty = .false. empty = .true.
do while(.not. not_empty) do while(empty)
e_blck = s_blck + index(blck(s_blck:),IO_EOL) - 2 e_blck = s_blck + index(blck(s_blck:),IO_EOL) - 2
line = IO_rmComment(blck(s_blck:e_blck)) line = IO_rmComment(blck(s_blck:e_blck))
if(len_trim(line) == 0) then empty = len_trim(line) == 0
s_blck = e_blck + 2 if(empty) s_blck = e_blck + 2
not_empty = .false.
else
not_empty = .true.
endif
enddo enddo