Skip to content

Commit 2c8a759

Browse files
EgorkaKulikovMarkoutte
authored andcommitted
Do not generate long commented blocks in contest.
1 parent b9ac17e commit 2c8a759

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,19 +394,14 @@ abstract class CgAbstractRenderer(
394394

395395
val isBlockTooLarge = workaround(LONG_CODE_FRAGMENTS) { block.size > LARGE_CODE_BLOCK_SIZE }
396396

397-
if (isBlockTooLarge) {
398-
print("/*")
399-
println(" This block of code is ${block.size} lines long and could lead to compilation error")
400-
}
401-
402-
withIndent {
403-
for (statement in block) {
404-
statement.accept(this)
397+
if (!isBlockTooLarge) {
398+
withIndent {
399+
for (statement in block) {
400+
statement.accept(this)
401+
}
405402
}
406403
}
407404

408-
if (isBlockTooLarge) println("*/")
409-
410405
print("}")
411406

412407
if (printNextLine) println()
@@ -959,6 +954,6 @@ abstract class CgAbstractRenderer(
959954
/**
960955
* @see [LONG_CODE_FRAGMENTS]
961956
*/
962-
private const val LARGE_CODE_BLOCK_SIZE: Int = 1000
957+
private const val LARGE_CODE_BLOCK_SIZE: Int = 150
963958
}
964959
}

0 commit comments

Comments
 (0)