Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Issue 10471002: Avoid repeated declaration of the same loop variable. (Closed)

Created:
8 years, 6 months ago by Mads Ager (google)
Modified:
8 years, 6 months ago
Reviewers:
ngeoffray
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Avoid repeated declaration of the same loop variable. The following code: void main() { int j = 0; for (int i = 0; i < 10; i++) { j++; } } would generate the following: for (var j = 0, i = 0; i < 10; ) { j = j + 1; var i = i + 1; } with this change the 'var' in the body disappears. R=ngeoffray@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8192

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -9 lines) Patch
M lib/compiler/compiler.dart View 1 chunk +1 line, -3 lines 0 comments Download
M lib/compiler/implementation/dart2js.dart View 1 chunk +1 line, -3 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Mads Ager (google)
8 years, 6 months ago (2012-06-01 13:09:43 UTC) #1
ngeoffray
8 years, 6 months ago (2012-06-01 13:12:49 UTC) #2
STV!

Powered by Google App Engine
This is Rietveld 408576698