mirror of
https://github.com/github/codeql.git
synced 2025-12-24 20:56:33 +01:00
Apply code review findings
This commit is contained in:
@@ -3191,9 +3191,7 @@ open class KotlinFileExtractor(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (e.origin != IrStatementOrigin.FOR_LOOP ||
|
if (e.origin != IrStatementOrigin.FOR_LOOP ||
|
||||||
e.statements.size != 2 ||
|
e.statements.size != 2) {
|
||||||
(e.statements[0] as? IrVariable)?.origin != IrDeclarationOrigin.FOR_LOOP_ITERATOR ||
|
|
||||||
(e.statements[1] as? IrWhileLoop)?.origin != IrStatementOrigin.FOR_LOOP_INNER_WHILE) {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3240,9 +3238,9 @@ open class KotlinFileExtractor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val id = extractLoop(innerWhile, null, parent, callable) { p, idx ->
|
val id = extractLoop(innerWhile, null, parent, callable) { p, idx ->
|
||||||
val loopId = tw.getFreshIdLabel<DbEnhancedforstmt>()
|
tw.getFreshIdLabel<DbEnhancedforstmt>().also {
|
||||||
tw.writeStmts_enhancedforstmt(loopId, p, idx, callable)
|
tw.writeStmts_enhancedforstmt(it, p, idx, callable)
|
||||||
loopId
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extractVariableExpr(loopVar, callable, id, 0, id, extractInitializer = false)
|
extractVariableExpr(loopVar, callable, id, 0, id, extractInitializer = false)
|
||||||
@@ -4143,13 +4141,13 @@ open class KotlinFileExtractor(
|
|||||||
) {
|
) {
|
||||||
val id = extractLoop(loop, 1, stmtExprParent, callable) { parent, idx ->
|
val id = extractLoop(loop, 1, stmtExprParent, callable) { parent, idx ->
|
||||||
if (loop is IrWhileLoop) {
|
if (loop is IrWhileLoop) {
|
||||||
val id = tw.getFreshIdLabel<DbWhilestmt>()
|
tw.getFreshIdLabel<DbWhilestmt>().also {
|
||||||
tw.writeStmts_whilestmt(id, parent, idx, callable)
|
tw.writeStmts_whilestmt(it, parent, idx, callable)
|
||||||
id
|
}
|
||||||
} else {
|
} else {
|
||||||
val id = tw.getFreshIdLabel<DbDostmt>()
|
tw.getFreshIdLabel<DbDostmt>().also {
|
||||||
tw.writeStmts_dostmt(id, parent, idx, callable)
|
tw.writeStmts_dostmt(it, parent, idx, callable)
|
||||||
id
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
extractExpressionExpr(loop.condition, callable, id, 0, id)
|
extractExpressionExpr(loop.condition, callable, id, 0, id)
|
||||||
|
|||||||
Reference in New Issue
Block a user