diff options
author | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2015-11-04 16:53:48 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2015-11-06 08:49:45 +0000 |
commit | e9b051f0ca39529f5ec78d39c5339f40e135e52a (patch) | |
tree | 2315330535ca5c5c5e7ec0492a80d70ff7fb6a1a /src/corelib/tools/qdatetime.cpp | |
parent | 0d14cdd30e66d0d65d3aa6ab2f08bba4b0f0bceb (diff) |
Fix false claim in comment.
Given that % and / have a defined consistency relation, neither is any
better defined for -ve operands than the other. The code is in fact
avoiding using -ve operands, not preferring "well-defined" / over
(allegedly less so) %, as it claimed.
Change-Id: I666690872f078c0f21f9af7a227c2bbf291704e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 18fb9db9b6..1519b8b926 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1728,7 +1728,7 @@ QTime QTime::addMSecs(int ms) const QTime t; if (isValid()) { if (ms < 0) { - // % not well-defined for -ve, but / is. + // %,/ not well-defined for -ve, so always work with +ve. int negdays = (MSECS_PER_DAY - ms) / MSECS_PER_DAY; t.mds = (ds() + ms + negdays * MSECS_PER_DAY) % MSECS_PER_DAY; } else { |