summaryrefslogtreecommitdiffstats
path: root/src/crsm.cpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2016-05-05 01:59:27 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2016-05-05 01:59:27 +0200
commit9e064af34b2223545ac82d7c554a7b52103637eb (patch)
tree2d8b755df69f0d4c102b6abeebdf5b5739e84abb /src/crsm.cpp
parent16ecf60717a786647c41cc528571959e2707667c (diff)
downloadmanager-9e064af34b2223545ac82d7c554a7b52103637eb.tar.gz
manager-9e064af34b2223545ac82d7c554a7b52103637eb.zip
Use startsWith() and endsWith() instead of comparing left() or right()
where possible
Diffstat (limited to 'src/crsm.cpp')
-rw-r--r--src/crsm.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crsm.cpp b/src/crsm.cpp
index 40d328e..be06197 100644
--- a/src/crsm.cpp
+++ b/src/crsm.cpp
@@ -847,7 +847,7 @@ QString CRSM::scenPath(QString scenName)
QString name = scenName.mid(split.first().length() + 1);
if(split.length() >= 2)
{
- if(split.first().right(4) == ".c4f")
+ if(split.first().endsWith(".c4f"))
{
const QStringList& entryList = QDir(Config.Auto.Volatile.Clonk.Directory).entryList(QStringList() << "*.c4f");
QString folderName = split.first();
@@ -1861,7 +1861,7 @@ QString CRSM::getCommand(const QString &message)
{
foreach(const QString& commandSign, Config.CRSM.CommandSigns)
{
- if(message.length() > commandSign.length() && message.leftRef(commandSign.length()) == commandSign)
+ if(message.startsWith(commandSign))
{
return message.mid(commandSign.length());
}
@@ -1886,7 +1886,7 @@ void CRSM::removeCommandSuffixes(QString& command)
{
foreach(const QString& suffix, Config.CRSM.CommandSuffixes)
{
- if(command.length() > suffix.length() && command.right(suffix.length()) == suffix)
+ if(command.endsWith(suffix))
{
command.chop(suffix.length());
break;