[libcxx-commits] [PATCH] D71996: [libcxx] span: Remove unneeded comparison

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 11 02:45:09 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb4a3e6b66428: [libcxx] span: Remove unneeded comparison (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71996/new/

https://reviews.llvm.org/D71996

Files:
  libcxx/include/span


Index: libcxx/include/span
===================================================================
--- libcxx/include/span
+++ libcxx/include/span
@@ -300,7 +300,7 @@
 
     _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
     {
-        _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T,N>[] index out of bounds");
+        _LIBCPP_ASSERT(__idx < size(), "span<T,N>[] index out of bounds");
         return __data[__idx];
     }
 
@@ -469,7 +469,7 @@
 
     _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
     {
-        _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T>[] index out of bounds");
+        _LIBCPP_ASSERT(__idx < size(), "span<T>[] index out of bounds");
         return __data[__idx];
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71996.243782.patch
Type: text/x-patch
Size: 797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200211/052b5000/attachment.bin>


More information about the libcxx-commits mailing list