util/AllocatedArray: use WritableBuffer::operator[]

This commit is contained in:
Max Kellermann 2019-12-09 09:42:07 +01:00 committed by Max Kellermann
parent 561ccf600f
commit 908b6a1939
1 changed files with 3 additions and 6 deletions

View File

@ -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 {