mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
better check for branch opt (#724)
* Added c++17 test configurations for clang5.0 and clang6.0 * Simplified optimization in span::operator[]
This commit is contained in:
parent
86be2366c7
commit
585f48ce55
@ -545,8 +545,7 @@ private:
|
||||
// wrap around to a value always greater than size when casted.
|
||||
|
||||
// check if we have enough space to wrap around
|
||||
if (narrow_cast<unsigned long long>(std::numeric_limits<index_type>::max()) <
|
||||
narrow_cast<unsigned long long>(std::numeric_limits<size_t>::max()))
|
||||
if (sizeof(index_type) <= sizeof(size_t))
|
||||
{
|
||||
return narrow_cast<size_t>(idx) < narrow_cast<size_t>(size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user