{"id":1300,"date":"2020-02-24T15:32:31","date_gmt":"2020-02-24T15:32:31","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/reliability\/concurentmodificationexception\/"},"modified":"2020-03-20T08:44:58","modified_gmt":"2020-03-20T08:44:58","slug":"concurentmodificationexception","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/concurentmodificationexception","title":{"rendered":"Lists should not be modified during iteration"},"content":{"rendered":"\n<p>The behavior of a loop is unspecified if the underlying list is modified while the iteration is in progress. Therefore it should be avoided.<\/p>\n\n\n\n<p>A workaround could be to store the items to be removed\/added in a separate list and then remove\/add them after the iteration is finished.<\/p>\n\n\n\n<p><strong>Non-compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-25.png\" alt=\"\" class=\"wp-image-1308\" width=\"518\" height=\"240\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-25.png 518w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-25-480x223.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 518px, 100vw\" \/><\/figure>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"311\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-26.png\" alt=\"\" class=\"wp-image-1309\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-26.png 802w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-26-480x186.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 802px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":97,"menu_order":15,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1300","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1300"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1300"}],"version-history":[{"count":4,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1300\/revisions"}],"predecessor-version":[{"id":1310,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1300\/revisions\/1310"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/97"}],"next":[{"title":"MM and mm tokens should be used correctly in parse\/format date-time functions","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/monthvsminute","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1178"}],"prev":[{"title":"Lists operations should be passed different arguments","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/identicallistarguments","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/583"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1300"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}