This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Current template generates global variable and could be more efficient if one wants to limit number of iterations by e.g. array length because the limit value is cached instead of being counted on each iteration Proposed template: for (var ${var default="i"} = 0, ${max} = 10; ${var} < ${max}; ${var}++) { ${selection}${cursor} } Generated result: for (var i = 0, max = 10; i < max; i++) { }
Should you agree, I can commit this simple change
Created attachment 147538 [details] patch
The patch is applied in web-main. Thanks for this.
Integrated into 'main-silver', will be available in build *201406040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6a6d6d1a7064 User: Petr Pisl <ppisl@netbeans.org> Log: #234727 - Improve code template of for block
thanks a lot, verified Product Version: NetBeans IDE Dev (Build web-main-881-on-20140607)
*** Bug 246703 has been marked as a duplicate of this bug. ***