Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> My feeling is that even the compilers written in CS101 will optimize this.

Then it might be harder than you think. You can't know that array.length won't change during the course of the loop. Even in your simple example, I would say it takes a fair bit of analysis (not for a human, of course), to be certain that "array[i]++" won't add elements to the list.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: