MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / xor

Method xor

Ports/CLDC11/src/java/util/BitSet.java:812–834  ·  view source on GitHub ↗
(BitSet bs)

Source from the content-addressed store, hash-verified

810 ///
811 /// - #and
812 public void xor(BitSet bs) {
813 int bsActualLen = bs.getActualArrayLength();
814 if (bsActualLen > bits.length) {
815 long[] tempBits = new long[bsActualLen];
816 System.arraycopy(bs.bits, 0, tempBits, 0, bs.actualArrayLength);
817 for (int i = 0; i < actualArrayLength; i++) {
818 tempBits[i] ^= bits[i];
819 }
820 bits = tempBits;
821 actualArrayLength = bsActualLen;
822 isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
823 } else {
824 long[] bsBits = bs.bits;
825 for (int i = 0; i < bsActualLen; i++) {
826 bits[i] ^= bsBits[i];
827 }
828 if (bsActualLen > actualArrayLength) {
829 actualArrayLength = bsActualLen;
830 isLengthActual = true;
831 }
832 }
833 needClear();
834 }
835
836 /// Returns the number of bits this `BitSet` has.
837 ///

Callers

nothing calls this directly

Calls 3

arraycopyMethod · 0.95
needClearMethod · 0.95
getActualArrayLengthMethod · 0.45

Tested by

no test coverage detected