mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +00:00
AK+Everywhere: Change int to size_t in JsonObject and JsonArray
This commit is contained in:
parent
66526cbbaf
commit
f45273649f
9 changed files with 14 additions and 14 deletions
|
@ -48,7 +48,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
int size() const { return m_values.size(); }
|
||||
size_t size() const { return m_values.size(); }
|
||||
bool is_empty() const { return m_values.is_empty(); }
|
||||
|
||||
JsonValue const& at(size_t index) const { return m_values.at(index); }
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
void clear() { m_values.clear(); }
|
||||
void append(JsonValue value) { m_values.append(move(value)); }
|
||||
void set(int index, JsonValue value) { m_values[index] = move(value); }
|
||||
void set(size_t index, JsonValue value) { m_values[index] = move(value); }
|
||||
|
||||
template<typename Builder>
|
||||
typename Builder::OutputType serialized() const;
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
|
||||
Vector<JsonValue> const& values() const { return m_values; }
|
||||
|
||||
void ensure_capacity(int capacity) { m_values.ensure_capacity(capacity); }
|
||||
void ensure_capacity(size_t capacity) { m_values.ensure_capacity(capacity); }
|
||||
|
||||
private:
|
||||
Vector<JsonValue> m_values;
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
int size() const { return m_members.size(); }
|
||||
size_t size() const { return m_members.size(); }
|
||||
bool is_empty() const { return m_members.is_empty(); }
|
||||
|
||||
JsonValue const& get(String const& key) const
|
||||
|
|
|
@ -90,7 +90,7 @@ bool JsonValue::equals(const JsonValue& other) const
|
|||
|
||||
if (is_array() && other.is_array() && as_array().size() == other.as_array().size()) {
|
||||
bool result = true;
|
||||
for (int i = 0; i < as_array().size(); ++i) {
|
||||
for (size_t i = 0; i < as_array().size(); ++i) {
|
||||
result &= as_array().at(i).equals(other.as_array().at(i));
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue