diff --git a/AK/JsonArray.h b/AK/JsonArray.h index c314fec7aa3..fb0764a47c2 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -69,7 +69,7 @@ public: template void for_each(Callback callback) const { - for (auto& value : m_values) + for (auto const& value : m_values) callback(value); } diff --git a/AK/JsonObject.h b/AK/JsonObject.h index 6b7cfe2d50b..8d27fdf829d 100644 --- a/AK/JsonObject.h +++ b/AK/JsonObject.h @@ -49,7 +49,7 @@ public: [[nodiscard]] JsonValue const& get(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); static JsonValue* s_null_value { nullptr }; if (!value) { if (!s_null_value) @@ -74,58 +74,58 @@ public: [[nodiscard]] bool has_null(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_null(); } [[nodiscard]] bool has_bool(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_bool(); } [[nodiscard]] bool has_string(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_string(); } [[nodiscard]] bool has_i32(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_i32(); } [[nodiscard]] bool has_u32(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_u32(); } [[nodiscard]] bool has_i64(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_i64(); } [[nodiscard]] bool has_u64(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_u64(); } [[nodiscard]] bool has_number(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_number(); } [[nodiscard]] bool has_array(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_array(); } [[nodiscard]] bool has_object(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_object(); } #ifndef KERNEL [[nodiscard]] [[nodiscard]] bool has_double(StringView key) const { - auto* value = get_ptr(key); + auto const* value = get_ptr(key); return value && value->is_double(); } #endif @@ -138,7 +138,7 @@ public: template void for_each_member(Callback callback) const { - for (auto& member : m_members) + for (auto const& member : m_members) callback(member.key, member.value); } diff --git a/AK/JsonPath.cpp b/AK/JsonPath.cpp index c366afad3d7..5ad87517b50 100644 --- a/AK/JsonPath.cpp +++ b/AK/JsonPath.cpp @@ -16,7 +16,7 @@ JsonPathElement JsonPathElement::any_object_element { Kind::AnyKey }; JsonValue JsonPath::resolve(const JsonValue& top_root) const { auto root = top_root; - for (auto& element : *this) { + for (auto const& element : *this) { switch (element.kind()) { case JsonPathElement::Kind::Key: root = JsonValue { root.as_object().get(element.key()) }; @@ -35,7 +35,7 @@ String JsonPath::to_string() const { StringBuilder builder; builder.append("{ ."); - for (auto& el : *this) { + for (auto const& el : *this) { builder.append(" > "); builder.append(el.to_string()); }