aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libparser/result/stringresult.cpp
diff options
context:
space:
mode:
authorRenaud Guezennec <renaud@rolisteam.org>2024-10-23 15:45:16 +0200
committerRenaud Guezennec <renaud@rolisteam.org>2024-12-29 14:46:30 +0100
commit6e297fc2666ec5994f62224b343c2707bdce7e3a (patch)
tree8a7100ca41a2fe3501d54729ece3c049153c640d /src/libparser/result/stringresult.cpp
parente695138e7ba727cb39e4b5b7dd42b41e569760d3 (diff)
downloadOneRoll-6e297fc2666ec5994f62224b343c2707bdce7e3a.tar.gz
OneRoll-6e297fc2666ec5994f62224b343c2707bdce7e3a.zip
Final changes
Diffstat (limited to 'src/libparser/result/stringresult.cpp')
-rw-r--r--src/libparser/result/stringresult.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/libparser/result/stringresult.cpp b/src/libparser/result/stringresult.cpp
index 113c22c..f6bf957 100644
--- a/src/libparser/result/stringresult.cpp
+++ b/src/libparser/result/stringresult.cpp
@@ -77,15 +77,17 @@ bool StringResult::hasHighLight() const
void StringResult::finished()
{
- if(isDigitOnly())
- {
- std::for_each(m_value.begin(), m_value.end(), [this](const QString& str) {
- auto die= new Die();
- die->setMaxValue(m_stringCount);
- die->setValue(str.toInt());
- insertResult(die);
- });
- }
+ if(!isDigitOnly())
+ return;
+
+ std::for_each(m_value.begin(), m_value.end(),
+ [this](const QString& str)
+ {
+ auto die= new Die();
+ die->setMaxValue(m_stringCount);
+ die->setValue(str.toInt());
+ insertResult(die);
+ });
}
void StringResult::setStringCount(int count)
@@ -95,11 +97,13 @@ void StringResult::setStringCount(int count)
bool StringResult::isDigitOnly() const
{
- return std::all_of(m_value.begin(), m_value.end(), [](const QString& str) {
- bool ok= false;
- str.toInt(&ok);
- return ok;
- });
+ return std::all_of(m_value.begin(), m_value.end(),
+ [](const QString& str)
+ {
+ bool ok= false;
+ str.toInt(&ok);
+ return ok;
+ });
}
Result* StringResult::getCopy() const