[evolution-data-server] e_util_utf8_make_valid: Remove dead code



commit 9301c1f7627e9d88fc6b125cb0de4a4c8d315846
Author: Christophe Dumez <christophe dumez intel com>
Date:   Tue Sep 20 15:34:51 2011 +0300

    e_util_utf8_make_valid: Remove dead code

 libedataserver/e-data-server-util.c |   24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)
---
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index 7597476..e03acff 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -459,33 +459,13 @@ e_util_utf8_make_valid (const gchar *str)
 	/* almost identical copy of glib's _g_utf8_make_valid() */
 	GString *string;
 	const gchar *remainder, *invalid;
-	gint remaining_bytes, valid_bytes, total_bytes, len = -1;
+	gint remaining_bytes, valid_bytes, total_bytes;
 
 	g_return_val_if_fail (str != NULL, NULL);
 
 	string = NULL;
 	remainder = str;
-	if (len == -1) {
-		remaining_bytes = strlen (str);
-	} else {
-		const gchar *start = str, *end = str;
-
-		while (len > 0) {
-			gunichar uc = g_utf8_get_char_validated (end, -1);
-
-			if (uc == (gunichar) -2 || uc == (gunichar) -1) {
-				end++;
-			} else if (uc == 0) {
-				break;
-			} else {
-				end = g_utf8_next_char (end);
-			}
-
-			len--;
-		}
-
-		remaining_bytes = end - start;
-	}
+	remaining_bytes = strlen (str);
 
 	total_bytes = remaining_bytes;
 



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