Skip to content

Commit 630c9db

Browse files
committed
Avoid unnecessary static fields asserts
1 parent 67cdd20 commit 630c9db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgMethodConstructor.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,14 @@ internal class CgMethodConstructor(val context: CgContext) : CgContextOwner by c
848848
depth: Int,
849849
visitedModels: MutableSet<UtModel>
850850
) {
851+
// if field is static, it is represents itself in "before" and
852+
// "after" state: no need to assert its equality to itself.
853+
if (fieldId.isStatic) {
854+
return
855+
}
856+
857+
// if model is already processed, so we don't want to add new statements
851858
if (fieldModel in visitedModels) {
852-
// this model is already processed, so we don't want to add new statements
853859
return
854860
}
855861

0 commit comments

Comments
 (0)