From 1ff02f570e0dd214ffc4a29d82b8876b362d74f9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 11 Dec 2008 11:50:02 +0000 Subject: [PATCH] Use the stored contents length in ::delete_chars() Instead of recomputing it, we can reuse the contents length we compute and store inside clutter_text_set_text(). --- clutter/clutter-text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index b12ca9697..d5213a46f 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -2962,7 +2962,7 @@ clutter_text_delete_chars (ClutterText *self, if (priv->position == -1) { - num_pos = offset_to_bytes (priv->text, len - n_chars); + num_pos = offset_to_bytes (priv->text, priv->n_chars - n_chars); new = g_string_erase (new, num_pos, -1); } else