From fc8a000e465bdf12e6aace540fd143e131701a63 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 24 Oct 2023 17:23:45 +0300 Subject: [PATCH] BAN: Fix bug of size of splice after slice() I have no idea what was I doing before :D --- BAN/include/BAN/Span.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BAN/include/BAN/Span.h b/BAN/include/BAN/Span.h index ff3e6332c3..a04c22a31b 100644 --- a/BAN/include/BAN/Span.h +++ b/BAN/include/BAN/Span.h @@ -127,8 +127,8 @@ namespace BAN ASSERT(start <= m_size); if (length == ~size_type(0)) length = m_size - start; - ASSERT(start + length <= m_size); - return Span(m_data + start, m_size - start - length); + ASSERT(m_size - start >= length); + return Span(m_data + start, length); } } \ No newline at end of file