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:
@@ -1301,6 +1301,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInStringSpecialized.kt")
|
||||
public void testForInStringSpecialized() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInStringSpecialized.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInUntil.kt")
|
||||
public void testForInUntil() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInUntil.kt");
|
||||
|
||||
Reference in New Issue
Block a user