Optimize for-in-string loops
For-in-string loop can be generated using specialized 'length' and 'charAt' method calls, and with cached string length. Note that update of the string variable in loop body doesn't affect loop execution semantics. #KT-21322 Fixed Target versions 1.2.20
This commit is contained in:
+7
-1
@@ -26,7 +26,7 @@ import org.junit.runner.RunWith;
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY test*/
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/codegen/box")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -15839,6 +15839,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInStringVarUpdatedInLoopBody.kt")
|
||||
public void testForInStringVarUpdatedInLoopBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forInStringVarUpdatedInLoopBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forIntRange.kt")
|
||||
public void testForIntRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forIntRange.kt");
|
||||
|
||||
Reference in New Issue
Block a user