summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-06 16:50:11 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-06 16:50:11 +0200
commitf9756d10d4d1c5ea7737cf3a237b1f966d6b7a01 (patch)
treec88df1366e9af3097edd2025494564ea92e0cb2a /src/helpers/MiscFunctions.cpp
parent0d7a8cca790e8fa71a83e4dce09fbe5a0af38cbc (diff)
changed C++ std to C++23, use std::string::contains
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index cb1d88d6..126600f3 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -137,7 +137,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
if (source.find_first_of("+") == 0) {
try {
- if (source.find('.') != std::string::npos)
+ if (source.contains("."))
result = relative + std::stof(source.substr(1));
else
result = relative + std::stoi(source.substr(1));
@@ -147,7 +147,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
}
} else if (source.find_first_of("-") == 0) {
try {
- if (source.find('.') != std::string::npos)
+ if (source.contains("."))
result = relative - std::stof(source.substr(1));
else
result = relative - std::stoi(source.substr(1));
@@ -157,7 +157,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
}
} else {
try {
- if (source.find('.') != std::string::npos)
+ if (source.contains("."))
result = stof(source);
else
result = stoi(source);