Use 'endsWith'

This commit is contained in:
Daniel Marjamäki 2017-04-01 18:27:53 +02:00
parent 1faca91c1d
commit c2a6ee3ea1
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include "timer.h"
#include "check.h"
#include "threadexecutor.h" // Threading model
#include "utils.h"
#include <algorithm>
#include <iostream>
@ -122,7 +123,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
else if (std::strncmp(argv[i], "--cppcheck-build-dir=", 21) == 0) {
_settings->buildDir = Path::fromNativeSeparators(argv[i] + 21);
if (_settings->buildDir.back() == '/')
if (endsWith(_settings->buildDir, '/'))
_settings->buildDir.erase(_settings->buildDir.size() - 1U);
}