Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

original loop

for (int i = init,  i < limit;  i += stride) {  // loop with array range check
    ...
    if (scale*i + offset < a.length) {  // array range check
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bfb6289717b5aee0-4e4d8203-425a457a-b952a33b-4c42b93b4d17e3e4b7eb362e"><ac:plain-text-body><![CDATA[        ... a[scale*i+offset] ...
]]></ac:plain-text-body></ac:structured-macro>
    } else raise_uncommon_trap();
    ...
}

   

 

after loop predication

if ( scale * imax + offset < a.length ) {  // loop predicate. imax is the maximum value of i where init <= i < limit
    for (int i = init,  i < limit;  i += stride) {  // loop without array range check
         ...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9bd66598d6a04fda-d2e87c53-45ca46f3-8a3fb3a3-34b635a678549d310e1e6e07"><ac:plain-text-body><![CDATA[         ... a[scale*i+offset] ...
]]></ac:plain-text-body></ac:structured-macro>
         ...
    }
} else raise_uncommon_trap();