Title: [260111] trunk/Source/WebKit
Revision
260111
Author
[email protected]
Date
2020-04-14 18:08:31 -0700 (Tue, 14 Apr 2020)

Log Message

Use CFArrayGetValues() in createArchiveList() in WebCoreArgumentCodersMac.mm
<https://webkit.org/b/210519>

Reviewed by Darin Adler.

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::createArchiveList):
- Use CFArrayGetValues() to copy array more efficiently.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260110 => 260111)


--- trunk/Source/WebKit/ChangeLog	2020-04-15 01:07:13 UTC (rev 260110)
+++ trunk/Source/WebKit/ChangeLog	2020-04-15 01:08:31 UTC (rev 260111)
@@ -1,3 +1,14 @@
+2020-04-14  David Kilzer  <[email protected]>
+
+        Use CFArrayGetValues() in createArchiveList() in WebCoreArgumentCodersMac.mm
+        <https://webkit.org/b/210519>
+
+        Reviewed by Darin Adler.
+
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::createArchiveList):
+        - Use CFArrayGetValues() to copy array more efficiently.
+
 2020-04-14  Tim Horton  <[email protected]>
 
         REGRESSION (r259898): Tabs occasionally go blank and get stuck that way

Modified: trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm (260110 => 260111)


--- trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2020-04-15 01:07:13 UTC (rev 260110)
+++ trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2020-04-15 01:08:31 UTC (rev 260111)
@@ -123,12 +123,10 @@
     *objectCount = archiveListArrayCount;
     *objects = static_cast<CFTypeRef*>(malloc(bufferSize.unsafeGet()));
 
+    CFArrayGetValues(archiveListArray, CFRangeMake(0, *objectCount), *objects);
     for (CFIndex i = 0; i < *objectCount; ++i) {
-        CFTypeRef object = CFArrayGetValueAtIndex(archiveListArray, i);
-        if (object == tokenNull)
+        if ((*objects)[i] == tokenNull)
             (*objects)[i] = nullptr;
-        else
-            (*objects)[i] = object;
     }
 
     if (protocolProperties)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to