(Bitset) Fixed Find* methods not handling empty bitsets

Former-commit-id: 48b9c83c0b786fffae18d5b5fff7bbbe89056c99
This commit is contained in:
Lynix 2015-03-16 21:44:30 +01:00
parent 2ca9989bfe
commit 70f9bb3aec
1 changed files with 5 additions and 0 deletions

View File

@ -480,6 +480,11 @@ unsigned int NzBitset<Block, Allocator>::FindFirstFrom(unsigned int blockIndex)
if (m_blocks[i])
break;
}
// Est-ce qu'on a un bloc non-nul ?
if (i == m_blocks.size()-1)
return npos;
Block block = m_blocks[i];
// Calcul de la position du LSB dans le bloc (et ajustement de la position)