mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
UnrollLoopAction: support counting loop; limit max iterations to unroll
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Unroll loop" "true"
|
||||
class Test {
|
||||
void test() {
|
||||
System.out.println("Hi!" + 0);
|
||||
System.out.println("Hi!" + 1);
|
||||
System.out.println("Hi!" + 2);
|
||||
System.out.println("Hi!" + 3);
|
||||
System.out.println("Hi!" + 4);
|
||||
System.out.println("Hi!" + 5);
|
||||
System.out.println("Hi!" + 6);
|
||||
System.out.println("Hi!" + 7);
|
||||
System.out.println("Hi!" + 8);
|
||||
System.out.println("Hi!" + 9);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// "Unroll loop" "true"
|
||||
class Test {
|
||||
void test() {
|
||||
if (0L % 7 != 6) {
|
||||
System.out.println("Hi!" + 0L);
|
||||
if (1L % 7 != 6) {
|
||||
System.out.println("Hi!" + 1L);
|
||||
if (2L % 7 != 6) {
|
||||
System.out.println("Hi!" + 2L);
|
||||
if (3L % 7 != 6) {
|
||||
System.out.println("Hi!" + 3L);
|
||||
if (4L % 7 != 6) {
|
||||
System.out.println("Hi!" + 4L);
|
||||
if (5L % 7 != 6) {
|
||||
System.out.println("Hi!" + 5L);
|
||||
if (6L % 7 != 6) {
|
||||
System.out.println("Hi!" + 6L);
|
||||
if (7L % 7 != 6) {
|
||||
System.out.println("Hi!" + 7L);
|
||||
if (8L % 7 != 6) {
|
||||
System.out.println("Hi!" + 8L);
|
||||
if (9L % 7 != 6) {
|
||||
System.out.println("Hi!" + 9L);
|
||||
if (10L % 7 != 6) {
|
||||
System.out.println("Hi!" + 10L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Unroll loop" "true"
|
||||
class Test {
|
||||
void test() {
|
||||
fo<caret>r (int i = 0; i < 10; i++) {
|
||||
System.out.println("Hi!" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Unroll loop" "false"
|
||||
class Test {
|
||||
void test() {
|
||||
fo<caret>r (int i = 0; i < 1000; i++) {
|
||||
System.out.println("Hi!" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Unroll loop" "true"
|
||||
class Test {
|
||||
void test() {
|
||||
fo<caret>r (long i = 0; i <= 10; i++) {
|
||||
if (i % 7 == 6) break;
|
||||
System.out.println("Hi!" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user