ein wenig mehr arg
This commit is contained in:
parent
62ba64f67a
commit
69d767ce42
|
@ -94,13 +94,11 @@ PascalString bitwiseDualAnd(PascalString a, PascalString b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PascalString bitwiseHexAnd(PascalString a, PascalString b) {
|
PascalString bitwiseHexAnd(PascalString a, PascalString b) {
|
||||||
PascalString shortString = a.length < b.length ? a : b;
|
PascalString result = {a.length, '0'};
|
||||||
PascalString longString = a.length > b.length ? a : b;
|
|
||||||
PascalString result = {longString.length, '0'};
|
|
||||||
|
|
||||||
for(int i = longString.length; i >= 0; --i) {
|
for(int i = a.length; i >= 0; --i) {
|
||||||
if(shortString.length < i) result.characters[i] = longString.characters[i];
|
if(b.length < i) result.characters[i] = a.characters[i];
|
||||||
result.characters[i] = longString.characters[i] & shortString.characters[i];
|
result.characters[i] = a.characters[i] & b.characters[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue