{"id":583,"date":"2019-12-09T10:29:15","date_gmt":"2019-12-09T10:29:15","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/reliability\/listsoperationsshouldnothavethesameargumenttwice\/"},"modified":"2020-03-20T08:44:58","modified_gmt":"2020-03-20T08:44:58","slug":"identicallistarguments","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/identicallistarguments","title":{"rendered":"Lists operations should be passed different arguments"},"content":{"rendered":"\n<p style=\"text-align:center\">Introduced in version: 1.3 (29 Jan 2020)<\/p>\n\n\n\n<p>When list operations &#8220;Change list\/Remove&#8221;, &#8220;Change list\/Replace&#8221;, &#8220;Union&#8221;, &#8220;Intersect&#8221; &#8220;Subtract&#8221;, &#8220;Contains&#8221; or &#8220;Equals&#8221; are called with the same list for both arguments then the result is trivial.<br>For example, when doing a union of a list with itself the result is the same list. When checking if a list contains itself the result is always true. When removing a list from itself the result is an empty list.<br><br>This is most likely a bug and some other argument was intended to be passed.<\/p>\n\n\n\n<p><strong>Noncompliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"304\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-5.png\" alt=\"\" class=\"wp-image-590\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-5.png 721w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-5-480x202.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 721px, 100vw\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"264\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-3.png\" alt=\"\" class=\"wp-image-584\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-3.png 741w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-3-480x171.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 741px, 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=\"713\" height=\"292\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-6.png\" alt=\"\" class=\"wp-image-591\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-6.png 713w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-6-480x197.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 713px, 100vw\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"776\" height=\"270\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-4.png\" alt=\"\" class=\"wp-image-585\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-4.png 776w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-4-480x167.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 776px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":97,"menu_order":14,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-583","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/583"}],"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=583"}],"version-history":[{"count":5,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/583\/revisions"}],"predecessor-version":[{"id":681,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/583\/revisions\/681"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/97"}],"next":[{"title":"Lists should not be modified during iteration","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/concurentmodificationexception","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1300"}],"prev":[{"title":"Identical expressions should not be used on both sides of a binary operator","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/identicalexpressionsbinary","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/694"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=583"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}