[gnome-builder] snippets: use stack allocated GtkTextIter when looking for current word.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: use stack allocated GtkTextIter when looking for current word.
- Date: Thu, 11 Sep 2014 21:22:58 +0000 (UTC)
commit 0c0b497eed26c2c8f645dec90cd42d7050112b95
Author: Christian Hergert <christian hergert me>
Date: Thu Sep 11 14:22:53 2014 -0700
snippets: use stack allocated GtkTextIter when looking for current word.
.../gb-source-snippet-completion-provider.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/snippets/gb-source-snippet-completion-provider.c
b/src/snippets/gb-source-snippet-completion-provider.c
index c9accc7..bfbdc96 100644
--- a/src/snippets/gb-source-snippet-completion-provider.c
+++ b/src/snippets/gb-source-snippet-completion-provider.c
@@ -223,12 +223,12 @@ static gchar *
get_word (GtkSourceCompletionProvider *provider,
GtkTextIter *iter)
{
- GtkTextIter *end;
+ GtkTextIter end;
gboolean moved = FALSE;
gunichar c;
gchar *word;
- end = gtk_text_iter_copy (iter);
+ gtk_text_iter_assign (&end, iter);
do
{
@@ -242,9 +242,7 @@ get_word (GtkSourceCompletionProvider *provider,
if (moved && !gtk_text_iter_is_start (iter))
gtk_text_iter_forward_char (iter);
- word = g_strstrip (gtk_text_iter_get_text (iter, end));
-
- gtk_text_iter_free (end);
+ word = g_strstrip (gtk_text_iter_get_text (iter, &end));
return word;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]