use more Util::sizeExpected

This commit is contained in:
Tiago Gomes
2012-05-28 21:27:52 +01:00
parent 54ae29ae02
commit 3ac854b2ff
4 changed files with 14 additions and 15 deletions

View File

@@ -14,10 +14,9 @@ class Indexer
{
public:
Indexer (const Ranges& ranges, bool calcOffsets = true)
: index_(0), indices_(ranges.size(), 0), ranges_(ranges)
: index_(0), indices_(ranges.size(), 0), ranges_(ranges),
size_(Util::sizeExpected (ranges))
{
size_ = std::accumulate (ranges.begin(), ranges.end(), 1,
std::multiplies<unsigned>());
if (calcOffsets) {
calculateOffsets();
}