diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-09-30 17:51:34 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-09-30 18:00:04 +0200 |
| commit | 685a9b6403180957e2ef4e200088ecca0de40017 (patch) | |
| tree | 50f19e6554379c5d2f079819b80bed098646a3d5 /libs/kstd | |
| parent | 9daf5549287b9e3addcac00e688f5ebc2decf0d0 (diff) | |
| download | kernel-685a9b6403180957e2ef4e200088ecca0de40017.tar.xz kernel-685a9b6403180957e2ef4e200088ecca0de40017.zip | |
kstd: ring_buffer: rename element_at_index
Diffstat (limited to 'libs/kstd')
| -rw-r--r-- | libs/kstd/kstd/ring_buffer.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/kstd/kstd/ring_buffer.hpp b/libs/kstd/kstd/ring_buffer.hpp index 61fbf360..075701ee 100644 --- a/libs/kstd/kstd/ring_buffer.hpp +++ b/libs/kstd/kstd/ring_buffer.hpp @@ -58,7 +58,7 @@ namespace kstd [[nodiscard]] constexpr auto at(size_type position) -> reference { panic_on_invalid_index(position); - return *element_at_index(position); + return *element_at(position); } //! Get the element at the specified index. @@ -68,7 +68,7 @@ namespace kstd [[nodiscard]] constexpr auto at(size_type position) const -> const_reference { panic_on_invalid_index(position); - return *element_at_index(position); + return *element_at(position); } //! @} @@ -135,7 +135,7 @@ namespace kstd //! //! @param position The logical (read-index relative) index of the element. //! @return A pointer to the object at given position. - constexpr auto element_at_index(size_type position) noexcept -> pointer + constexpr auto element_at(size_type position) noexcept -> pointer { auto base_pointer = reinterpret_cast<pointer>(m_storage.data()); auto storage_index = (m_read_index + position) % capacity(); @@ -146,7 +146,7 @@ namespace kstd //! //! @param position The logical (read-index relative) index of the element. //! @return A pointer to the object at given position. - constexpr auto element_at_index(size_type position) const noexcept -> const_pointer + constexpr auto element_at(size_type position) const noexcept -> const_pointer { return const_cast<ring_buffer *>(this)->element_at_index(position); } |
