diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-09-11 18:52:13 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-01-17 22:29:30 +0100 |
commit | 21735f24cf05cac5ef6f94c1fe2058b6e06ae67e (patch) | |
tree | fb8c8ceb8d4395e570d1fff67819fcf3784b6ee8 /src/corelib/time | |
parent | f854e77b8ea671e26e3d1bda621ba9063f8be970 (diff) |
Simplify some #if-ery and use positive tests
Two cases coincide without feature textdate, and the first falls
through to the second with the feature, making it possible to simplify
the #if-ery, converting its tests to positive form and skipping a
duplicate case body in the process.
Change-Id: I2c0ee800442474707bf8893bd72b9706fef54485
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time')
-rw-r--r-- | src/corelib/time/qdatetimeparser.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 6f582ed650..0b5be978f8 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -718,16 +718,12 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case DayOfWeekSectionShort: case DayOfWeekSectionLong: -#if !QT_CONFIG(textdate) - return 2; -#else +#if QT_CONFIG(textdate) mcount = 7; Q_FALLTHROUGH(); #endif case MonthSection: -#if !QT_CONFIG(textdate) - return 2; -#else +#if QT_CONFIG(textdate) if (count <= 2) return 2; @@ -743,7 +739,9 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const } return ret; } -#endif +#else + return 2; +#endif // textdate case MSecSection: return 3; case YearSection: |