Util: Change Job m_input string -> string_view

This commit is contained in:
Riyyi
2022-07-20 21:32:17 +02:00
parent b4100113fe
commit 4e6c5ca341
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -15,7 +15,7 @@
namespace Json {
Job::Job(const std::string& input)
Job::Job(std::string_view input)
: m_input(input)
{
// FIXME: Make this work for all newline types: \n, \r, \r\n
@@ -68,7 +68,7 @@ void Job::printErrorLine(Token token, const char* message)
message);
// Get the JSON line that caused the error
std::istringstream input(m_input);
std::istringstream input(m_input.data());
std::string line;
for (size_t i = 0; std::getline(input, line); ++i) {
if (i == token.line) {