aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnna Gringauze <annagrin@microsoft.com>2018-08-19 16:27:30 -0700
committerNeil MacIntosh <neilmac@fb.com>2018-08-19 16:27:30 -0700
commit585f48ce55c720a3f812f79ef57596e67f52eb89 (patch)
tree40fab118366f205a006ba0411c5df551e11a09fa /include
parent86be2366c73a19b77cc7a6674cc0e3d118efcdf9 (diff)
downloadplatform_external_Microsoft-GSL-585f48ce55c720a3f812f79ef57596e67f52eb89.tar.gz
platform_external_Microsoft-GSL-585f48ce55c720a3f812f79ef57596e67f52eb89.tar.bz2
platform_external_Microsoft-GSL-585f48ce55c720a3f812f79ef57596e67f52eb89.zip
better check for branch opt (#724)
* Added c++17 test configurations for clang5.0 and clang6.0 * Simplified optimization in span::operator[]
Diffstat (limited to 'include')
-rw-r--r--include/gsl/span3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/gsl/span b/include/gsl/span
index b3f4f83..a4f9256 100644
--- a/include/gsl/span
+++ b/include/gsl/span
@@ -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);
}