diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-11-14 23:50:30 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | 678ed0ed00ee93b2f6989de7fb2bc10fb3fb2977 (patch) | |
tree | 0f79a608adb7d678dfc120deaa301ae62c5547af /asl/span.hpp | |
parent | 8aad6443ded53db1b98aec63172b4e9944b3b6e9 (diff) |
Cleanup a bunch of lints
Diffstat (limited to 'asl/span.hpp')
-rw-r--r-- | asl/span.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/asl/span.hpp b/asl/span.hpp index 7135509..8f6fb4a 100644 --- a/asl/span.hpp +++ b/asl/span.hpp @@ -125,15 +125,15 @@ public: } } - constexpr span<T> subspan(isize_t offset, isize_t sub_size = dynamic_size) const + constexpr span<T> subspan(isize_t offset) const { ASL_ASSERT(offset <= size()); - - if (is_dynamic(sub_size)) - { - return span<T>{ data() + offset, size() - offset }; - } - + return span<T>{ data() + offset, size() - offset }; + } + + constexpr span<T> subspan(isize_t offset, isize_t sub_size) const + { + ASL_ASSERT(offset <= size() && !is_dynamic(sub_size)); ASL_ASSERT(sub_size <= size() - offset); return span<T>{ data() + offset, sub_size }; } |