mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:47:35 +00:00
AK+Userland: Rename Array::front/back to first/last
This is the name that is used for every other collection type so let's be consistent.
This commit is contained in:
parent
359365a06a
commit
c0ca6e470f
4 changed files with 7 additions and 7 deletions
|
@ -34,11 +34,11 @@ struct Array {
|
||||||
return __data[index];
|
return __data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] constexpr T const& front() const { return at(0); }
|
[[nodiscard]] constexpr T const& first() const { return at(0); }
|
||||||
[[nodiscard]] constexpr T& front() { return at(0); }
|
[[nodiscard]] constexpr T& first() { return at(0); }
|
||||||
|
|
||||||
[[nodiscard]] constexpr T const& back() const requires(Size > 0) { return at(Size - 1); }
|
[[nodiscard]] constexpr T const& last() const requires(Size > 0) { return at(Size - 1); }
|
||||||
[[nodiscard]] constexpr T& back() requires(Size > 0) { return at(Size - 1); }
|
[[nodiscard]] constexpr T& last() requires(Size > 0) { return at(Size - 1); }
|
||||||
|
|
||||||
[[nodiscard]] constexpr bool is_empty() const { return size() == 0; }
|
[[nodiscard]] constexpr bool is_empty() const { return size() == 0; }
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ private:
|
||||||
Gfx::Bitmap& choose_bitmap_from_volume()
|
Gfx::Bitmap& choose_bitmap_from_volume()
|
||||||
{
|
{
|
||||||
if (m_audio_muted)
|
if (m_audio_muted)
|
||||||
return *m_volume_level_bitmaps.back().bitmap;
|
return *m_volume_level_bitmaps.last().bitmap;
|
||||||
|
|
||||||
for (auto& pair : m_volume_level_bitmaps) {
|
for (auto& pair : m_volume_level_bitmaps) {
|
||||||
if (m_audio_volume >= pair.volume_threshold)
|
if (m_audio_volume >= pair.volume_threshold)
|
||||||
|
|
|
@ -115,7 +115,7 @@ constexpr auto MakeMixedScaleFactorBandArray()
|
||||||
Array<ScaleFactorBand, N> result {};
|
Array<ScaleFactorBand, N> result {};
|
||||||
|
|
||||||
constexpr auto long_bands = MakeLongScaleFactorBandArray<sizes_long>();
|
constexpr auto long_bands = MakeLongScaleFactorBandArray<sizes_long>();
|
||||||
constexpr auto short_bands = MakeShortScaleFactorBandArray<sizes_short, long_bands.back().end + 1>();
|
constexpr auto short_bands = MakeShortScaleFactorBandArray<sizes_short, long_bands.last().end + 1>();
|
||||||
|
|
||||||
for (size_t i = 0; i < long_bands.size(); i++) {
|
for (size_t i = 0; i < long_bands.size(); i++) {
|
||||||
result[i] = long_bands[i];
|
result[i] = long_bands[i];
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
MipMap const& mipmap(unsigned lod) const
|
MipMap const& mipmap(unsigned lod) const
|
||||||
{
|
{
|
||||||
if (lod >= m_mipmaps.size())
|
if (lod >= m_mipmaps.size())
|
||||||
return m_mipmaps.back();
|
return m_mipmaps.last();
|
||||||
|
|
||||||
return m_mipmaps.at(lod);
|
return m_mipmaps.at(lod);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue