@@ -1321,7 +1321,7 @@ end subroutine json_clone
1321
1321
! @note If new data is added to the [[json_value]] type,
1322
1322
! then this would need to be updated.
1323
1323
1324
- recursive subroutine json_value_clone_func (from ,to ,parent ,previous ,next , children , tail )
1324
+ recursive subroutine json_value_clone_func (from ,to ,parent ,previous ,tail )
1325
1325
1326
1326
implicit none
1327
1327
@@ -1330,8 +1330,6 @@ recursive subroutine json_value_clone_func(from,to,parent,previous,next,children
1330
1330
! ! must not already be associated)
1331
1331
type (json_value),pointer ,optional :: parent ! ! to%parent
1332
1332
type (json_value),pointer ,optional :: previous ! ! to%previous
1333
- type (json_value),pointer ,optional :: next ! ! to%next
1334
- type (json_value),pointer ,optional :: children ! ! to%children
1335
1333
logical ,optional :: tail ! ! if "to" is the tail of
1336
1334
! ! its parent's children
1337
1335
@@ -1352,33 +1350,28 @@ recursive subroutine json_value_clone_func(from,to,parent,previous,next,children
1352
1350
to % var_type = from% var_type
1353
1351
to % n_children = from% n_children
1354
1352
1355
- ! allocate and associate the pointers as necessary:
1356
-
1357
- if (present (parent)) to % parent = > parent
1358
- if (present (previous)) to % previous = > previous
1359
- if (present (next)) to % next = > next
1360
- if (present (children)) to % children = > children
1353
+ ! allocate and associate the pointers as necessary:
1354
+ if (present (parent)) to % parent = > parent
1355
+ if (present (previous)) to % previous = > previous
1361
1356
if (present (tail)) then
1362
1357
if (tail .and. associated (to % parent)) to % parent% tail = > to
1363
1358
end if
1364
1359
1365
1360
if (associated (from% next) .and. associated (to % parent)) then
1366
1361
! we only clone the next entry in an array
1367
1362
! if the parent has also been cloned
1368
- allocate (to % next)
1369
- call json_value_clone_func(from% next,&
1370
- to % next,&
1371
- previous= to ,&
1372
- parent= to % parent,&
1373
- tail= (.not. associated (from% next% next)))
1363
+ call json_value_clone_func(from = from% next,&
1364
+ to = to % next,&
1365
+ previous = to ,&
1366
+ parent = to % parent,&
1367
+ tail = (.not. associated (from% next% next)))
1374
1368
end if
1375
1369
1376
1370
if (associated (from% children)) then
1377
- allocate (to % children)
1378
- call json_value_clone_func(from% children,&
1379
- to % children,&
1380
- parent= to ,&
1381
- tail= (.not. associated (from% children% next)))
1371
+ call json_value_clone_func(from = from% children,&
1372
+ to = to % children,&
1373
+ parent = to ,&
1374
+ tail = (.not. associated (from% children% next)))
1382
1375
end if
1383
1376
1384
1377
end if
0 commit comments