Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: Source/core/svg/animation/SMILTime.cpp

Issue 499933002: Simplify SMILTime operators (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move +/- operators to the header. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/animation/SMILTime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SMILTime.cpp
diff --git a/Source/core/svg/animation/SMILTime.cpp b/Source/core/svg/animation/SMILTime.cpp
index 7abef296001dca9191d29faf4697b6411346878d..674c18d857ed6a443b047e4ce82a8441e351cc39 100644
--- a/Source/core/svg/animation/SMILTime.cpp
+++ b/Source/core/svg/animation/SMILTime.cpp
@@ -31,31 +31,10 @@
using namespace blink;
-SMILTime blink::operator+(const SMILTime& a, const SMILTime& b)
-{
- if (a.isUnresolved() || b.isUnresolved())
- return SMILTime::unresolved();
- if (a.isIndefinite() || b.isIndefinite())
- return SMILTime::indefinite();
- return a.value() + b.value();
-}
-
-SMILTime blink::operator-(const SMILTime& a, const SMILTime& b)
-{
- if (a.isUnresolved() || b.isUnresolved())
- return SMILTime::unresolved();
- if (a.isIndefinite() || b.isIndefinite())
- return SMILTime::indefinite();
- return a.value() - b.value();
-}
-
SMILTime blink::operator*(const SMILTime& a, const SMILTime& b)
{
- if (a.isUnresolved() || b.isUnresolved())
- return SMILTime::unresolved();
- if (!a.value() || !b.value())
+ // Equal operators have to be used instead of negation here to make NaN work as well.
+ if (a.value() == 0 || b.value() == 0)
return SMILTime(0);
- if (a.isIndefinite() || b.isIndefinite())
- return SMILTime::indefinite();
return a.value() * b.value();
}
« no previous file with comments | « Source/core/svg/animation/SMILTime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698