From: Fabien Potencier Date: Fri, 8 Jun 2012 14:53:09 +0000 (+0200) Subject: merged branch catchamonkey/compiler_outdent (PR #747) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=dfc9edce334b2f157e84351586359f4871b8c8af;p=web%2Fkonrad%2Ftwig.git merged branch catchamonkey/compiler_outdent (PR #747) Commits ------- 459a076 The Compiler outdent method will now only reduce the indentation if it's OK to do so, It moves and modifies the check up above the indentation modification. Discussion ---------- Compiler outdent step validation moved up and modified The Compiler outdent method will now only reduce the indentation if it's OK to do so, It moves and modifies the check up above the indentation modification. It's a small improvement but saves a wasted decrement of a variable, when you know an exception will be thrown immediately following it. --------------------------------------------------------------------------- by nikic at 2012-06-07T23:18:00Z Compared to throwing an exception decrementing a variable has practically no cost ;) PS: Not saying that the change is bad or something like that, only saying that performance is the wrong reason to do it :) --------------------------------------------------------------------------- by catchamonkey at 2012-06-07T23:20:23Z Yeah, there is no performance gain, but the code only executes that which is necessary. It's like there being no point preparing a response before you know if you are going to send it. (slightly OTT example, but you get what I mean) :) --- dfc9edce334b2f157e84351586359f4871b8c8af