From 908b6a193944b2b5dcb36c9688fab4e87f29c8cf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 Dec 2019 09:42:07 +0100 Subject: [PATCH] util/AllocatedArray: use WritableBuffer::operator[] --- src/util/AllocatedArray.hxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx index 2ed856a18..aaa788420 100644 --- a/src/util/AllocatedArray.hxx +++ b/src/util/AllocatedArray.hxx @@ -30,6 +30,7 @@ #ifndef ALLOCATED_ARRAY_HXX #define ALLOCATED_ARRAY_HXX +#include "ConstBuffer.hxx" #include "WritableBuffer.hxx" #include "Compiler.h" @@ -148,18 +149,14 @@ public: * Returns one element. No bounds checking. */ reference_type operator[](size_type i) noexcept { - assert(i < size()); - - return buffer.data[i]; + return buffer[i]; } /** * Returns one constant element. No bounds checking. */ const_reference_type operator[](size_type i) const noexcept { - assert(i < size()); - - return buffer.data[i]; + return buffer[i]; } iterator begin() noexcept {