[Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Oct 2014 16:53:38 +0000 (16:53 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Oct 2014 16:53:38 +0000 (16:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137723

Reviewed by Simon Fraser.

Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
of CFDictionaryGetValue() as we are not actually interested in the
value.

No new tests, no behavior change.

* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::isSizeAvailable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp

index 45f4991..b4f157f 100644 (file)
@@ -1,3 +1,19 @@
+2014-10-15  Chris Dumez  <cdumez@apple.com>
+
+        [Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
+        https://bugs.webkit.org/show_bug.cgi?id=137723
+
+        Reviewed by Simon Fraser.
+
+        Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
+        of CFDictionaryGetValue() as we are not actually interested in the
+        value.
+
+        No new tests, no behavior change.
+
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::isSizeAvailable):
+
 2014-10-15  Mihnea Ovidenie  <mihnea@adobe.com>
 
         Use modern loops in subtrees selection code
index 4797eb5..261409c 100644 (file)
@@ -189,8 +189,8 @@ bool ImageSource::isSizeAvailable()
     if (!image0Properties)
         return false;
 
-    return CFDictionaryGetValue(image0Properties.get(), kCGImagePropertyPixelWidth)
-        && CFDictionaryGetValue(image0Properties.get(), kCGImagePropertyPixelHeight);
+    return CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelWidth)
+        && CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelHeight);
 }
 
 static ImageOrientation orientationFromProperties(CFDictionaryRef imageProperties)