Avoid unnecessary comparison if both Typeface are NULL

BUG=skia:

Review URL: https://codereview.chromium.org/1177833004
This commit is contained in:
jin.a.yang 2015-06-17 04:47:18 -07:00 committed by Commit bot
parent 781d58215f
commit 48fc0ea272

View File

@ -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);
}
///////////////////////////////////////////////////////////////////////////////