Skip to content

Commit 8416929

Browse files
committed
Fix assertion condition per review comment
1 parent 2f686b7 commit 8416929

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/span

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public:
267267
_LIBCPP_HIDE_FROM_ABI constexpr explicit span(_It __first, size_type __count) : __data_{std::to_address(__first)} {
268268
(void)__count;
269269
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
270-
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__count == 0 ? true : std::to_address(__first) != nullptr,
270+
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__count == 0 || std::to_address(__first) != nullptr,
271271
"passed nullptr with non-zero length in span's constructor (iterator, len)");
272272
}
273273

@@ -444,7 +444,7 @@ public:
444444
template <__span_compatible_iterator<element_type> _It>
445445
_LIBCPP_HIDE_FROM_ABI constexpr span(_It __first, size_type __count)
446446
: __data_{std::to_address(__first)}, __size_{__count} {
447-
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__count == 0 ? true : std::to_address(__first) != nullptr,
447+
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__count == 0 || std::to_address(__first) != nullptr,
448448
"passed nullptr with non-zero length in span's constructor (iterator, len)");
449449
}
450450

0 commit comments

Comments
 (0)