Reverted a (premature) optimization that can lead to out of bound write.

This commit is contained in:
Ion Gaztañaga
2014-04-21 22:52:06 +02:00
parent 5013f3fd69
commit 71b99683b9

View File

@@ -549,7 +549,9 @@ class flat_tree
pos = const_cast<const flat_tree&>(*this).priv_lower_bound(pos, ce, KeyOfValue()(val)); pos = const_cast<const flat_tree&>(*this).priv_lower_bound(pos, ce, KeyOfValue()(val));
//Check if already present //Check if already present
if (pos != ce && !val_cmp(val, *pos)){ if (pos != ce && !val_cmp(val, *pos)){
skips[unique_burst-1] += static_cast<size_type>(unique_burst > 0); if(unique_burst > 0){
++skips[unique_burst-1];
}
continue; continue;
} }