This commit is contained in:
Amos Bird 2020-12-10 11:30:44 +08:00 committed by Nikita Mikhailov
parent ccc426cd10
commit 6648b89843
2 changed files with 8 additions and 4 deletions

View File

@ -576,6 +576,8 @@ public:
{
if (isSmall())
{
if (small.size())
return 0;
auto min_val = std::numeric_limits<std::make_unsigned_t<T>>::max();
for (const auto & x : small)
{
@ -593,11 +595,13 @@ public:
{
if (isSmall())
{
if (small.size())
return 0;
auto max_val = std::numeric_limits<std::make_unsigned_t<T>>::min();
for (const auto & x : small)
{
auto val = x.getValue();
if (val < max_val)
if (val > max_val)
max_val = val;
}
return max_val;

View File

@ -91,9 +91,9 @@ tag4 [0,1,2,3,4,5,6,7,8,9] [5,999,2] [2,888,20] [0,1,3,4,6,7,8,9,20]
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,100,200,500]
[30,31,32,33,100,200,500]
[100,200,500]
4294967295
4294967295
4294967295
0
0
0
1
0
0