Core/Bitset: Fix OR/XOR with two bitset of similar size

Former-commit-id: 5de82c13f397c04497c11a98e1bd745c686cbb50
This commit is contained in:
Lynix 2016-05-17 17:08:45 +02:00
parent 5be03ab2f2
commit 3dc81263dc
1 changed files with 4 additions and 4 deletions

View File

@ -329,8 +329,8 @@ namespace Nz
template<typename Block, class Allocator> template<typename Block, class Allocator>
void Bitset<Block, Allocator>::PerformsOR(const Bitset& a, const Bitset& b) void Bitset<Block, Allocator>::PerformsOR(const Bitset& a, const Bitset& b)
{ {
const Bitset& greater = (a.GetBlockCount() > b.GetBlockCount()) ? a : b; const Bitset& greater = (a.GetSize() > b.GetSize()) ? a : b;
const Bitset& lesser = (a.GetBlockCount() > b.GetBlockCount()) ? b : a; const Bitset& lesser = (a.GetSize() > b.GetSize()) ? b : a;
unsigned int maxBlockCount = greater.GetBlockCount(); unsigned int maxBlockCount = greater.GetBlockCount();
unsigned int minBlockCount = lesser.GetBlockCount(); unsigned int minBlockCount = lesser.GetBlockCount();
@ -358,8 +358,8 @@ namespace Nz
template<typename Block, class Allocator> template<typename Block, class Allocator>
void Bitset<Block, Allocator>::PerformsXOR(const Bitset& a, const Bitset& b) void Bitset<Block, Allocator>::PerformsXOR(const Bitset& a, const Bitset& b)
{ {
const Bitset& greater = (a.GetBlockCount() > b.GetBlockCount()) ? a : b; const Bitset& greater = (a.GetSize() > b.GetSize()) ? a : b;
const Bitset& lesser = (a.GetBlockCount() > b.GetBlockCount()) ? b : a; const Bitset& lesser = (a.GetSize() > b.GetSize()) ? b : a;
unsigned int maxBlockCount = greater.GetBlockCount(); unsigned int maxBlockCount = greater.GetBlockCount();
unsigned int minBlockCount = lesser.GetBlockCount(); unsigned int minBlockCount = lesser.GetBlockCount();