0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::simd: Ensure return counts are bound to max values.

This commit is contained in:
Jason Volk 2020-09-13 02:56:24 -07:00
parent e39182be25
commit 13d267cefb

View file

@ -124,7 +124,11 @@ noexcept
count += consume; count += consume;
} }
return count; return u64x2
{
std::min(count[0], max[0]),
std::min(count[1], max[1]),
};
} }
/// Streaming consumer /// Streaming consumer
@ -209,5 +213,9 @@ noexcept
count += consume; count += consume;
} }
return count; return u64x2
{
count[0],
std::min(count[1], max[1])
};
} }