[gtk+] Minor optimization



commit 2358be732daeff41233ff5c6044269c10ac20126
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 25 22:44:07 2011 -0400

    Minor optimization
    
    No need to get the cursor position twice in a row.

 gtk/a11y/gtkentryaccessible.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
index 2da1a65..86abf23 100644
--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -598,7 +598,7 @@ gtk_entry_accessible_remove_selection (AtkText *text,
                                        gint     selection_num)
 {
   GtkWidget *widget;
-  gint start, end, caret_pos;
+  gint start, end;
 
   widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
   if (widget == NULL)
@@ -609,8 +609,7 @@ gtk_entry_accessible_remove_selection (AtkText *text,
 
   if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
     {
-      caret_pos = gtk_editable_get_position (GTK_EDITABLE (widget));
-      gtk_editable_select_region (GTK_EDITABLE (widget), caret_pos, caret_pos);
+      gtk_editable_select_region (GTK_EDITABLE (widget), end, end);
       return TRUE;
     }
   else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]