mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
AK: Do bounds checking (assertions) in Span::operator[]
This commit is contained in:
parent
dae071629f
commit
a65f178ce8
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, the SerenityOS developers.
|
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -209,11 +209,11 @@ public:
|
||||||
|
|
||||||
ALWAYS_INLINE constexpr T& operator[](size_t index) const
|
ALWAYS_INLINE constexpr T& operator[](size_t index) const
|
||||||
{
|
{
|
||||||
return this->m_values[index];
|
return at(index);
|
||||||
}
|
}
|
||||||
ALWAYS_INLINE constexpr T& operator[](size_t index)
|
ALWAYS_INLINE constexpr T& operator[](size_t index)
|
||||||
{
|
{
|
||||||
return this->m_values[index];
|
return at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE constexpr Span& operator=(const Span<T>& other)
|
ALWAYS_INLINE constexpr Span& operator=(const Span<T>& other)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue