From eb33e76416c7e8091bd33365b8b0917a9146868b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 29 Aug 2017 15:51:37 +0100 Subject: Use Json::valueToQuotedString directly --- libsolidity/ast/ASTPrinter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libsolidity/ast') diff --git a/libsolidity/ast/ASTPrinter.cpp b/libsolidity/ast/ASTPrinter.cpp index 09191433..81e6cc44 100644 --- a/libsolidity/ast/ASTPrinter.cpp +++ b/libsolidity/ast/ASTPrinter.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -585,9 +585,7 @@ void ASTPrinter::printSourcePart(ASTNode const& _node) *m_ostream << indentation() << " Source: " << - /// Note: this "abuses" the JSON library to print a string (as it is not a valid root node). - /// It also makes a copy of the string. - jsonCompactPrint(m_source.substr(location.start, location.end - location.start)) << + Json::valueToQuotedString(m_source.substr(location.start, location.end - location.start).c_str()) << endl; } } -- cgit