Skip to content

Commit 6a2ec92

Browse files
committed
Merge pull request #183 from jacobwilliams/loop
added checks to avoid unnecessary looping when traversing arrays if a…
2 parents 93bf219 + 9896165 commit 6a2ec92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/json_value_module.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,7 @@ subroutine json_get_array(json, me, array_callback)
42044204
return
42054205
end if
42064206
call array_callback(json, element, i, count)
4207+
if (json%exception_thrown) exit
42074208
element => element%next
42084209
end do
42094210
case default
@@ -4270,7 +4271,7 @@ recursive subroutine traverse(p)
42704271
return
42714272
end if
42724273
call traverse(element)
4273-
if (finished) exit
4274+
if (finished .or. json%exception_thrown) exit
42744275
element => element%next
42754276
end do
42764277
end if

0 commit comments

Comments
 (0)