mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
eliminate boxing in BinaryColumn boolean ops
This commit is contained in:
parent
52b6de12ae
commit
c6458c901d
@ -7,11 +7,10 @@
|
|||||||
|
|
||||||
package com.dfsek.terra.api.structure.feature;
|
package com.dfsek.terra.api.structure.feature;
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.Range;
|
|
||||||
|
|
||||||
import java.util.function.BinaryOperator;
|
|
||||||
import java.util.function.IntConsumer;
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.Range;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A column of binary data
|
* A column of binary data
|
||||||
@ -97,7 +96,7 @@ public class BinaryColumn {
|
|||||||
return bool(that, Boolean::logicalXor);
|
return bool(that, Boolean::logicalXor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BinaryColumn bool(BinaryColumn that, BinaryOperator<Boolean> operator) {
|
private BinaryColumn bool(BinaryColumn that, BooleanBinaryOperator operator) {
|
||||||
int smallMinY = Math.min(this.minY, that.minY);
|
int smallMinY = Math.min(this.minY, that.minY);
|
||||||
int bigMaxY = Math.max(this.maxY, that.maxY);
|
int bigMaxY = Math.max(this.maxY, that.maxY);
|
||||||
|
|
||||||
@ -120,4 +119,8 @@ public class BinaryColumn {
|
|||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private interface BooleanBinaryOperator {
|
||||||
|
boolean apply(boolean a, boolean b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user