Skip to content

Commit 0ead068

Browse files
committed
Use string_view on operator[]
1 parent 23c1d77 commit 0ead068

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ Json::operator[](size_t index)
597597
}
598598

599599
Json&
600-
Json::operator[](const std::string& key)
600+
Json::operator[](const JTJSON_STRING_VIEW& key)
601601
{
602602
if (type_ != Object) {
603603
clear();

json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class Json
213213
Json& operator=(Json&&) noexcept;
214214

215215
Json& operator[](size_t);
216-
Json& operator[](const std::string&);
216+
Json& operator[](const JTJSON_STRING_VIEW&);
217217

218218
operator std::string() const
219219
{

0 commit comments

Comments
 (0)