Pass const object to has_json_object_field.

GitOrigin-RevId: 7e7dfda846e15e8b977674e4c3a3ab759720449c
This commit is contained in:
levlam 2018-10-31 16:03:38 +03:00
parent 035e4a69ed
commit 4378f96948
2 changed files with 2 additions and 2 deletions

View File

@ -576,7 +576,7 @@ Slice JsonValue::get_type_name(Type type) {
}
}
bool has_json_object_field(JsonObject &object, Slice name) {
bool has_json_object_field(const JsonObject &object, Slice name) {
for (auto &field_value : object) {
if (field_value.first == name) {
return true;

View File

@ -816,7 +816,7 @@ auto json_array(const A &a, F &&f) {
});
}
bool has_json_object_field(JsonObject &object, Slice name);
bool has_json_object_field(const JsonObject &object, Slice name);
Result<JsonValue> get_json_object_field(JsonObject &object, Slice name, JsonValue::Type type,
bool is_optional = true) TD_WARN_UNUSED_RESULT;