From 7bf88fbb0912632ea64644951274b6f5b16ae614 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 15 Jan 2016 14:22:08 +0300 Subject: [PATCH] Use substr() instead of assignment plus erase() --- lib/preprocessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index df5a862c1..a23f5f97b 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -2761,10 +2761,10 @@ public: if (tok->strAt(-1) != "##") { const std::map::const_iterator it = macros.find(str); if (it != macros.end() && it->second->_macro.find('(') == std::string::npos) { - str = it->second->_macro; - const std::string::size_type whitespacePos = str.find(' '); + const std::string& macro = it->second->_macro; + const std::string::size_type whitespacePos = macro.find(' '); if (whitespacePos != std::string::npos) - str.erase(0, whitespacePos); + str = macro.substr(whitespacePos); else str = ""; }