Cleanup: simplify for
This commit is contained in:
@@ -43,9 +43,9 @@ class InitControlFlowInfo(map: MutableMap<VariableDescriptor, VariableControlFlo
|
||||
// merge = input of MergeInstruction
|
||||
// returns true if definite initialization in when happens here
|
||||
fun checkDefiniteInitializationInWhen(merge: InitControlFlowInfo): Boolean {
|
||||
for (entry in entries) {
|
||||
if (entry.value.initState == InitState.INITIALIZED_EXHAUSTIVELY &&
|
||||
merge[entry.key]?.initState == InitState.INITIALIZED) {
|
||||
for ((key, value) in entries) {
|
||||
if (value.initState == InitState.INITIALIZED_EXHAUSTIVELY &&
|
||||
merge[key]?.initState == InitState.INITIALIZED) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,10 +109,9 @@ class PseudocodeVariablesData(val pseudocode: Pseudocode, private val bindingCon
|
||||
if (instruction is MagicInstruction) {
|
||||
if (instruction.kind === MagicKind.EXHAUSTIVE_WHEN_ELSE) {
|
||||
val exitInstructionData = enterInstructionData.copy()
|
||||
for (entry in enterInstructionData.entries) {
|
||||
if (!entry.value.definitelyInitialized()) {
|
||||
exitInstructionData.put(entry.key,
|
||||
VariableControlFlowState.createInitializedExhaustively(entry.value.isDeclared))
|
||||
for ((key, value) in enterInstructionData) {
|
||||
if (!value.definitelyInitialized()) {
|
||||
exitInstructionData.put(key, VariableControlFlowState.createInitializedExhaustively(value.isDeclared))
|
||||
}
|
||||
}
|
||||
return exitInstructionData
|
||||
|
||||
+3
-3
@@ -361,9 +361,9 @@ class ClassTranslator private constructor(
|
||||
}
|
||||
|
||||
private fun generateBridgesToTraitImpl(properties: MutableList<JsPropertyInitializer>) {
|
||||
for (entry in CodegenUtil.getNonPrivateTraitMethods(descriptor).entries) {
|
||||
if (!areNamesEqual(entry.key, entry.value)) {
|
||||
properties += generateDelegateCall(entry.value, entry.key, JsLiteral.THIS, context())
|
||||
for ((key, value) in CodegenUtil.getNonPrivateTraitMethods(descriptor)) {
|
||||
if (!areNamesEqual(key, value)) {
|
||||
properties += generateDelegateCall(value, key, JsLiteral.THIS, context())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user