[vte] Reuse ->pending array instead of creating a new one



commit 11bf7a92d4e0cc75ceda1fcd4da892f58e63b4b8
Author: Behdad Esfahbod <behdad behdad org>
Date:   Sun Aug 16 01:53:18 2009 -0400

    Reuse ->pending array instead of creating a new one

 src/vte.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 6472db4..0906e9e 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -4053,14 +4053,7 @@ next_match:
 
 	/* Remove most of the processed characters. */
 	if (start < wcount) {
-		unichars = g_array_new(FALSE, TRUE, sizeof(gunichar));
-		g_array_append_vals(unichars,
-				    &g_array_index(terminal->pvt->pending,
-						   gunichar,
-						   start),
-				    wcount - start);
-		g_array_free(terminal->pvt->pending, TRUE);
-		terminal->pvt->pending = unichars;
+		g_array_remove_range(terminal->pvt->pending, 0, start);
 	} else {
 		g_array_set_size(terminal->pvt->pending, 0);
 		/* If we're out of data, we needn't pause to let the



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