summaryrefslogtreecommitdiff
path: root/AK/JsonParser.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-04 11:47:21 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-04 11:47:21 +0200
commitb62a12c687bf1f6d6e0dde129ef783139592e6c0 (patch)
treeee382853ce303fdc022fd16c08e07199505911e5 /AK/JsonParser.h
parent93596dc00db7eef6763765fdc45686cfe0f53929 (diff)
downloadserenity-b62a12c687bf1f6d6e0dde129ef783139592e6c0.zip
JsonParser: Some minor optimizations
- Return more specific types from parse_array() and parse_object(). - Don't create a throwaway String in extract_while(). - Use a StringView in parse_number() to avoid a throwaway String.
Diffstat (limited to 'AK/JsonParser.h')
-rw-r--r--AK/JsonParser.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/AK/JsonParser.h b/AK/JsonParser.h
index 76f7d7e5bf..343530d7f4 100644
--- a/AK/JsonParser.h
+++ b/AK/JsonParser.h
@@ -23,8 +23,8 @@ private:
void consume_specific(char expected_ch);
void consume_string(const char*);
String consume_quoted_string();
- JsonValue parse_array();
- JsonValue parse_object();
+ JsonArray parse_array();
+ JsonObject parse_object();
JsonValue parse_number();
JsonValue parse_string();
JsonValue parse_false();
@@ -36,7 +36,7 @@ private:
void consume_while(C);
template<typename C>
- String extract_while(C);
+ Vector<char, 128> extract_while(C);
StringView m_input;
int m_index { 0 };