GtkTreeModel *model,
GtkTreeIter *iter,
gpointer user_data)
- {
+ {
const gchar *str = NULL;
/* The col to get data from is in userdata */
gtk_tree_model_get(model, a, data_column, &str_a, -1);
gtk_tree_model_get(model, b, data_column, &str_b, -1);
- if (str_a == NULL || str_b == NULL){
- if (str_a == NULL && str_b == NULL)
- return 0;
+ if (str_a == str_b) {
+ /* it's worth testing because a lot of row point to
+ the same data */
+ return 0;
+ }
+ else if (str_a == NULL || str_b == NULL) {
ret = (str_a == NULL) ? -1 : 1;
- }else{
+ }
+ else {
ret = g_ascii_strcasecmp(str_a,str_b);
}
return ret;