mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 22:59:47 +08:00
Fixed 'count()'
This commit is contained in:
parent
a7956c5e80
commit
6073040fa7
@ -316,8 +316,9 @@ namespace etl
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t count = std::distance(range.first, range.second);
|
||||
erase(range.first, range.second);
|
||||
return 1;
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,7 +378,9 @@ namespace etl
|
||||
//*********************************************************************
|
||||
size_t count(key_value_parameter_t key) const
|
||||
{
|
||||
return (find(key == end()) ? 0 : 1);
|
||||
std::pair<iterator, iterator> range = equal_range(key);
|
||||
|
||||
return std::distance(range.first, range.second);
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user