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

Unified Diff: src/core/SkTypeface.cpp

Issue 1177833004: Avoid unnecessary comparison if both Typeface are NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index fcbb7452d0297e4e5add82ff4ac5c222553bf36a..2c7db68d87534701a821bd6e68f1d1b75d26b93f 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -107,7 +107,7 @@ uint32_t SkTypeface::UniqueID(const SkTypeface* face) {
}
bool SkTypeface::Equal(const SkTypeface* facea, const SkTypeface* faceb) {
- return SkTypeface::UniqueID(facea) == SkTypeface::UniqueID(faceb);
+ return facea == faceb || SkTypeface::UniqueID(facea) == SkTypeface::UniqueID(faceb);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698