CSAPP-3e-Solutions icon indicating copy to clipboard operation
CSAPP-3e-Solutions copied to clipboard

5.14~16 中循环控制条件有点瑕疵

Open aQuaYi opened this issue 7 years ago • 0 comments

你的答案

  for (i = 0; i < length-6; i+=6) {

更好的答案

  for (i = 0; i < length-5; i+=6) {

当 length 是 6 的倍数的时候,你的答案会让下个 for 循环执行 6 次。而更好的答案就不会。

aQuaYi avatar Aug 17 '18 07:08 aQuaYi