From 258d0a6adef713c52e9bb476e5aa9f91260ff968 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 12 Jun 2020 16:08:40 +0200 Subject: [PATCH] Running astyle [ci skip]. --- lib/library.cpp | 15 +++++---------- test/testlibrary.cpp | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/library.cpp b/lib/library.cpp index ea9d0bbe7..f5192a0ca 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -712,8 +712,7 @@ Library::Error Library::loadFunction(const tinyxml2::XMLElement * const node, co return Error(BAD_ATTRIBUTE_VALUE, (!p ? "\"\"" : argnode->GetText())); // Set validation expression ac.valid = argnode->GetText(); - } - else if (argnodename == "minsize") { + } else if (argnodename == "minsize") { const char *typeattr = argnode->Attribute("type"); if (!typeattr) return Error(MISSING_ATTRIBUTE, "type"); @@ -1226,24 +1225,20 @@ bool Library::isCompliantValidationExpression(const char* p) range = true; has_dot = false; has_E = false; - } - else if ((*p == '-')|| (*p == '+')) + } else if ((*p == '-')|| (*p == '+')) error |= (!std::isdigit(*(p + 1))); else if (*p == ',') { range = false; error |= *(p + 1) == '.'; has_dot = false; has_E = false; - } - else if (*p == '.') { + } else if (*p == '.') { error |= has_dot | (!std::isdigit(*(p + 1))); has_dot = true; - } - else if (*p == 'E' || *p == 'e') { + } else if (*p == 'E' || *p == 'e') { error |= has_E; has_E = true; - } - else + } else return false; } return !error; diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index fe33ce9b0..8320eaeb1 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -73,8 +73,7 @@ private: return library.load(doc); } - void isCompliantValidationExpression() - { + void isCompliantValidationExpression() { ASSERT_EQUALS(true, Library::isCompliantValidationExpression("-1")); ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1")); ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1:"));