[Commits] [SCM] claws branch, master, updated. 3.17.3-140-gfeaaa53

ticho at claws-mail.org ticho at claws-mail.org
Wed Mar 13 21:40:34 CET 2019


The branch, master has been updated
       via  feaaa5322aa86dae2c7ececec07d9d0ead20f9f1 (commit)
      from  7ed4e3b5db58b2df89820d06390c307ea2271faa (commit)

Summary of changes:
 src/common/mgutils.c |   48 ------------------------------------------------
 src/common/mgutils.h |    2 --
 src/ldapctrl.c       |    3 ++-
 3 files changed, 2 insertions(+), 51 deletions(-)


- Log -----------------------------------------------------------------
commit feaaa5322aa86dae2c7ececec07d9d0ead20f9f1
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Mar 13 21:39:28 2019 +0100

    Remove functions mgu_*_test_unq_nc()
    
    Only one of them was being used, only once, and
    it was replaced by a straightforward call to
    g_list_find_custom().

diff --git a/src/common/mgutils.c b/src/common/mgutils.c
index 941fc26..8b90eab 100644
--- a/src/common/mgutils.c
+++ b/src/common/mgutils.c
@@ -317,53 +317,5 @@ gchar *mgu_slist_longest_entry( GSList *list ) {
 }	
 
 /*
- * Test whether string appears in list of strings, ignoring case. NULL or empty
- * strings will be ignored.
- * Enter: list List to process.
- *        str  String to test.
- * Return: TRUE if string is unique.
- */
-gboolean mgu_slist_test_unq_nc( GSList *list, gchar *str ) {
-	GSList *node;
-
-	if( str ) {
-		if( strlen( str ) > 0 ) {
-			node = list;
-			while( node ) {
-				if( g_utf8_collate( str, node->data ) == 0 )
-					return FALSE;
-				node = g_slist_next( node );
-			}
-			return TRUE;
-		}
-	}
-	return FALSE;
-}
-
-/*
- * Test whether string appears in list of strings, ignoring case. NULL or empty
- * strings will be ignored.
- * Enter: list List to process.
- *        str  String to test.
- * Return: TRUE if string is unique.
- */
-gboolean mgu_list_test_unq_nc( GList *list, gchar *str ) {
-	GList *node;
-
-	if( str ) {
-		if( strlen( str ) > 0 ) {
-			node = list;
-			while( node ) {
-				if( g_utf8_collate( str, node->data ) == 0 )
-					return FALSE;
-				node = g_list_next( node );
-			}
-			return TRUE;
-		}
-	}
-	return FALSE;
-}
-
-/*
 * End of Source.
 */
diff --git a/src/common/mgutils.h b/src/common/mgutils.h
index 6e944c2..f589458 100644
--- a/src/common/mgutils.h
+++ b/src/common/mgutils.h
@@ -53,8 +53,6 @@ GList *mgu_parse_string		( gchar *line, const gint maxTokens,
 void mgu_str_unescape		( gchar *str );
 void mgu_str_ltc2space		( gchar *str, gchar chlead, gchar chtail );
 gchar *mgu_slist_longest_entry	( GSList *list );
-gboolean mgu_slist_test_unq_nc	( GSList *list, gchar *str );
-gboolean mgu_list_test_unq_nc	( GList *list, gchar *str );
 
 #endif /* __MGUTILS_H__ */
 
diff --git a/src/ldapctrl.c b/src/ldapctrl.c
index 2a67c62..4cb929e 100644
--- a/src/ldapctrl.c
+++ b/src/ldapctrl.c
@@ -254,7 +254,8 @@ void ldapctl_criteria_list_clear( LdapControl *ctl ) {
 void ldapctl_criteria_list_add( LdapControl *ctl, gchar *attr ) {
 	cm_return_if_fail( ctl != NULL );
 	if( attr != NULL ) {
-		if( mgu_list_test_unq_nc( ctl->listCriteria, attr ) ) {
+		if( !g_list_find_custom( ctl->listCriteria, attr,
+					(GCompareFunc)g_utf8_collate ) ) {
 			debug_print("adding to criteria list: %s\n", attr);
 			ctl->listCriteria = g_list_append(
 				ctl->listCriteria, g_strdup( attr ) );

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list