Am 07.05.2015 um 14:48 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>:

> Le 07/05/2015 14:38, Stephan Witt a écrit :
>>> This looks good. Why do you need the loop in allowSpellCheck to go in 
>>> reverse?
>> 
>> Because depth() is called only once then. Of course looping forward will 
>> produce the same result.
> 
> Did you measure the gain? I think this is a case of making the code 
> (slightly) less clear for no real benefit.

No, I don't need to measure it. It's a common practice. Perhaps it's not 
significant anymore with more computing power inside your notebook than on the 
main frame of my university 15 years ago.

See here for another example:

http://www.guyrutenberg.com/2007/11/07/optimizing-for-loops-reverse-loops/

Stephan

Reply via email to