From c17c9a4c3175c1e9ccb98164b2e6b3a4e68d1cbe Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 5 Mar 2015 17:20:38 +0100 Subject: [PATCH] style fixes --- libevmcore/Assembly.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libevmcore/Assembly.cpp b/libevmcore/Assembly.cpp index 7f6a16116..5e9d2fcd3 100644 --- a/libevmcore/Assembly.cpp +++ b/libevmcore/Assembly.cpp @@ -182,16 +182,16 @@ string Assembly::getLocationFromSources(StringMap const& _sourceCodes, SourceLoc if (it == _sourceCodes.end()) return ""; - string toReturn = it->second; - if (_location.start >= (int)toReturn.size()) + string const& source = it->second; + if (size_t(_location.start) >= source.size()) return ""; - toReturn = toReturn.substr(_location.start, _location.end - _location.start); - auto newLinePos = toReturn.find_first_of("\n"); - if (newLinePos != string::npos && newLinePos != toReturn.size() - 1) - toReturn = toReturn.substr(0, newLinePos) + "..."; + string cut = source.substr(_location.start, _location.end - _location.start); + auto newLinePos = cut.find_first_of("\n"); + if (newLinePos != string::npos) + cut = cut.substr(0, newLinePos) + "..."; - return move(toReturn); + return move(cut); } ostream& Assembly::streamRLP(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const @@ -239,7 +239,7 @@ ostream& Assembly::streamRLP(ostream& _out, string const& _prefix, StringMap con default: BOOST_THROW_EXCEPTION(InvalidOpcode()); } - _out << string(20, ' ') << sourceLine << endl; + _out << string("\t\t") << sourceLine << endl; } if (!m_data.empty() || !m_subs.empty())