Browse Source

JavaBytecode: Fixed Contains check being inversed

kindlich 4 years ago
parent
commit
7cd318a1ce
No known key found for this signature in database

+ 4
- 4
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaExpressionVisitor.java View File

@@ -1116,19 +1116,19 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
1116 1116
 					//Compare non-int types beforehand
1117 1117
 					if (itemType.type == BasicTypeID.LONG || itemType.type == BasicTypeID.ULONG) {
1118 1118
 						javaWriter.lCmp();
1119
-						javaWriter.ifNE(loopStart);
1119
+						javaWriter.ifEQ(loopStart);
1120 1120
 					} else if (itemType.type == BasicTypeID.FLOAT) {
1121 1121
 						javaWriter.fCmp();
1122
-						javaWriter.ifNE(loopStart);
1122
+						javaWriter.ifEQ(loopStart);
1123 1123
 					} else if (itemType.type == BasicTypeID.DOUBLE) {
1124 1124
 						javaWriter.dCmp();
1125
-						javaWriter.ifNE(loopStart);
1125
+						javaWriter.ifEQ(loopStart);
1126 1126
 					} else
1127 1127
 						javaWriter.ifICmpNE(loopStart);
1128 1128
 				} else {
1129 1129
 					//If equals, use Object.equals in case of null
1130 1130
 					javaWriter.invokeStatic(new JavaMethod(JavaClass.fromInternalName("java/util/Objects", JavaClass.Kind.CLASS), JavaMethod.Kind.STATIC, "equals", false, "(Ljava/lang/Object;Ljava/lang/Object;)Z", 0, false));
1131
-					javaWriter.ifNE(loopStart);
1131
+					javaWriter.ifEQ(loopStart);
1132 1132
 					// If ==
1133 1133
 					// javaWriter.ifACmpNe(loopStart);
1134 1134
 				}

Loading…
Cancel
Save