1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:17:35 +00:00

AK: Use east const style in Json{Array,Object}.h

This commit is contained in:
Max Wipfli 2021-06-28 10:21:20 +02:00 committed by Andreas Kling
parent 9179a2ea73
commit 53480180cb
2 changed files with 15 additions and 14 deletions

View file

@ -17,7 +17,7 @@ public:
JsonArray() = default;
~JsonArray() = default;
JsonArray(const JsonArray& other)
JsonArray(JsonArray const& other)
: m_values(other.m_values)
{
}
@ -28,13 +28,13 @@ public:
}
template<typename T>
JsonArray(const Vector<T>& vector)
JsonArray(Vector<T> const& vector)
{
for (auto& value : vector)
m_values.append(move(value));
}
JsonArray& operator=(const JsonArray& other)
JsonArray& operator=(JsonArray const& other)
{
if (this != &other)
m_values = other.m_values;
@ -51,8 +51,8 @@ public:
int size() const { return m_values.size(); }
bool is_empty() const { return m_values.is_empty(); }
const JsonValue& at(size_t index) const { return m_values.at(index); }
const JsonValue& operator[](size_t index) const { return at(index); }
JsonValue const& at(size_t index) const { return m_values.at(index); }
JsonValue const& operator[](size_t index) const { return at(index); }
void clear() { m_values.clear(); }
void append(JsonValue value) { m_values.append(move(value)); }
@ -73,7 +73,7 @@ public:
callback(value);
}
const Vector<JsonValue>& values() const { return m_values; }
Vector<JsonValue> const& values() const { return m_values; }
void ensure_capacity(int capacity) { m_values.ensure_capacity(capacity); }