diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-24 15:28:01 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-10 11:49:13 (GMT) |
commit | 2f67aef23d4192fadb222dc79311fb5ffbbc36ce (patch) | |
tree | b655efe8ef71e8743d32bbd331d317af23c0cb13 | |
parent | 794fdf40a1bc85dded519d7c737f73690e3a6e42 (diff) | |
download | CMake-2f67aef23d4192fadb222dc79311fb5ffbbc36ce.zip CMake-2f67aef23d4192fadb222dc79311fb5ffbbc36ce.tar.gz CMake-2f67aef23d4192fadb222dc79311fb5ffbbc36ce.tar.bz2 |
AUTOGEN: Generators: Cleanup and optimize ParseForUic method
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 01cc1b3..1ada434 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -931,23 +931,17 @@ void cmQtAutoGenerators::ParseForUic( "[\n][ \t]*#[ \t]*include[ \t]+" "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]"); - std::string::size_type matchOffset = 0; - if ((strstr(contentsString.c_str(), "ui_") != CM_NULLPTR) && - (uiIncludeRegExp.find(contentsString))) { - do { + const char* contentChars = contentsString.c_str(); + if (strstr(contentChars, "ui_") != CM_NULLPTR) { + while (uiIncludeRegExp.find(contentChars)) { const std::string currentUi = uiIncludeRegExp.match(1); - - std::string basename = + const std::string basename = cmsys::SystemTools::GetFilenameWithoutLastExtension(currentUi); - // basename should be the part of the ui filename used for // finding the correct header, so we need to remove the ui_ part - basename = basename.substr(3); - - includedUis[realName].push_back(basename); - - matchOffset += uiIncludeRegExp.end(); - } while (uiIncludeRegExp.find(contentsString.c_str() + matchOffset)); + includedUis[realName].push_back(basename.substr(3)); + contentChars += uiIncludeRegExp.end(); + } } } |