Title: [185650] trunk/Source/WebKit2
Revision
185650
Author
[email protected]
Date
2015-06-17 08:21:19 -0700 (Wed, 17 Jun 2015)

Log Message

[WK2] valueForKey() shouldn't copy the defaults map
https://bugs.webkit.org/show_bug.cgi?id=146050

Reviewed by Sam Weinig.

* Shared/WebPreferencesStore.cpp:
(WebKit::valueForKey): Avoid copying the defaults HashMap by binding the return value to a reference.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185649 => 185650)


--- trunk/Source/WebKit2/ChangeLog	2015-06-17 14:13:30 UTC (rev 185649)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-17 15:21:19 UTC (rev 185650)
@@ -1,3 +1,13 @@
+2015-06-17  Zan Dobersek  <[email protected]>
+
+        [WK2] valueForKey() shouldn't copy the defaults map
+        https://bugs.webkit.org/show_bug.cgi?id=146050
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebPreferencesStore.cpp:
+        (WebKit::valueForKey): Avoid copying the defaults HashMap by binding the return value to a reference.
+
 2015-06-16  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Inhibit screen saver when playing full screen video

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp (185649 => 185650)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp	2015-06-17 14:13:30 UTC (rev 185649)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp	2015-06-17 15:21:19 UTC (rev 185650)
@@ -184,7 +184,7 @@
     if (overridenDefaultsIt != overridenDefaults.end() && overridenDefaultsIt->value.type() == ToType<MappedType>::value)
         return as<MappedType>(overridenDefaultsIt->value);
 
-    auto defaultsMap = defaults();
+    auto& defaultsMap = defaults();
     auto defaultsIt = defaultsMap.find(key);
     if (defaultsIt != defaultsMap.end() && defaultsIt->value.type() == ToType<MappedType>::value)
         return as<MappedType>(defaultsIt->value);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to