Skip to content

Commit 7712dce

Browse files
committed
code cleanup
1 parent afe55de commit 7712dce

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/json_value_module.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11291,10 +11291,7 @@ subroutine parse_number(json, unit, str, value)
1129111291
case(CK_'0':CK_'9') !valid characters for numbers
1129211292

1129311293
!add it to the string:
11294-
if (ip>ltmp) then
11295-
tmp = tmp // blank_chunk
11296-
ltmp = len(tmp)
11297-
end if
11294+
call expand_tmp()
1129811295
tmp(ip:ip) = c
1129911296
ip = ip + 1
1130011297

@@ -11303,10 +11300,7 @@ subroutine parse_number(json, unit, str, value)
1130311300
if (is_integer) is_integer = .false.
1130411301

1130511302
!add it to the string:
11306-
if (ip>ltmp) then
11307-
tmp = tmp // blank_chunk
11308-
ltmp = len(tmp)
11309-
end if
11303+
call expand_tmp()
1131011304
tmp(ip:ip) = c
1131111305
ip = ip + 1
1131211306

@@ -11315,10 +11309,7 @@ subroutine parse_number(json, unit, str, value)
1131511309
if (is_integer .and. (.not. first)) is_integer = .false.
1131611310

1131711311
!add it to the string:
11318-
if (ip>ltmp) then
11319-
tmp = tmp // blank_chunk
11320-
ltmp = len(tmp)
11321-
end if
11312+
call expand_tmp()
1132211313
tmp(ip:ip) = c
1132311314
ip = ip + 1
1132411315

@@ -11368,6 +11359,15 @@ subroutine parse_number(json, unit, str, value)
1136811359

1136911360
end if
1137011361

11362+
contains
11363+
subroutine expand_tmp()
11364+
!! expand the temporary string `tmp` if necessary.
11365+
if (ip>ltmp) then
11366+
tmp = tmp // blank_chunk
11367+
ltmp = len(tmp)
11368+
end if
11369+
end subroutine expand_tmp
11370+
1137111371
end subroutine parse_number
1137211372
!*****************************************************************************************
1137311373

0 commit comments

Comments
 (0)