Optimize op-assignment statement.
This commit is contained in:
@@ -6,7 +6,7 @@ let x = 10;
|
||||
loop {
|
||||
print(x);
|
||||
|
||||
x = x - 1;
|
||||
x -= 1;
|
||||
|
||||
if x <= 0 { break; }
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ let x = 1_000_000;
|
||||
print("Ready... Go!");
|
||||
|
||||
while x > 0 {
|
||||
x = x - 1;
|
||||
x -= 1;
|
||||
}
|
||||
|
||||
print("Finished. Run time = " + now.elapsed() + " seconds.");
|
||||
|
@@ -4,5 +4,5 @@ let x = 10;
|
||||
|
||||
while x > 0 {
|
||||
print(x);
|
||||
x = x - 1;
|
||||
x -= 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user