[GTK] avoid unneeded object creation when calling Vector::append
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 00:41:55 +0000 (00:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 00:41:55 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88805

Patch by Arnaud Renevier <arno@renevier.net> on 2012-07-26
Reviewed by Alexey Proskuryakov.

No new tests: no change in functionality.

* platform/gtk/ContextMenuGtk.cpp:
(WebCore::contextMenuItemVector):
* platform/gtk/KeyBindingTranslator.h:
(WebCore::KeyBindingTranslator::addPendingEditorCommand):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/ContextMenuGtk.cpp
Source/WebCore/platform/gtk/KeyBindingTranslator.h

index b8453db..fefc34b 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-26  Arnaud Renevier  <arno@renevier.net>
+
+        [GTK] avoid unneeded object creation when calling Vector::append
+        https://bugs.webkit.org/show_bug.cgi?id=88805
+
+        Reviewed by Alexey Proskuryakov.
+
+        No new tests: no change in functionality.
+
+        * platform/gtk/ContextMenuGtk.cpp:
+        (WebCore::contextMenuItemVector):
+        * platform/gtk/KeyBindingTranslator.h:
+        (WebCore::KeyBindingTranslator::addPendingEditorCommand):
+
 2012-07-26  Benjamin Poulain  <bpoulain@apple.com>
 
         Initialize the Event Names' strings from read only memory
index 8916525..8c002c4 100644 (file)
@@ -103,7 +103,7 @@ Vector<ContextMenuItem> contextMenuItemVector(const PlatformMenuDescription menu
         GtkWidget* widget = static_cast<GtkWidget*>(item->data);
         if (!GTK_IS_MENU_ITEM(widget))
             continue;
-        menuItemVector.append(ContextMenuItem(GTK_MENU_ITEM(widget)));
+        menuItemVector.append(GTK_MENU_ITEM(widget));
     }
 
     return menuItemVector;
index 0991a44..bc4a3ff 100644 (file)
@@ -33,7 +33,7 @@ public:
 
     enum EventType { KeyDown, KeyPress };
     void getEditorCommandsForKeyEvent(GdkEventKey*, EventType, Vector<WTF::String>&);
-    void addPendingEditorCommand(const char* command) { m_pendingEditorCommands.append(WTF::String(command)); }
+    void addPendingEditorCommand(const char* command) { m_pendingEditorCommands.append(command); }
 
 private:
     GRefPtr<GtkWidget> m_nativeWidget;