[gdm] rearrange gdm_user_collate
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] rearrange gdm_user_collate
- Date: Fri, 11 Jun 2010 00:18:49 +0000 (UTC)
commit 2762fc0170c23403421de3e8d6d8e5b7a5a13325
Author: Ray Strode <rstrode redhat com>
Date: Tue Mar 16 00:25:17 2010 -0400
rearrange gdm_user_collate
This way we don't make unnecessary assignments
https://bugzilla.gnome.org/show_bug.cgi?id=610179
gui/simple-greeter/gdm-user.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user.c b/gui/simple-greeter/gdm-user.c
index 4ff7a19..97b9eaa 100644
--- a/gui/simple-greeter/gdm-user.c
+++ b/gui/simple-greeter/gdm-user.c
@@ -364,18 +364,6 @@ gdm_user_collate (GdmUser *user1,
g_return_val_if_fail (GDM_IS_USER (user1), 0);
g_return_val_if_fail (GDM_IS_USER (user2), 0);
- if (user1->real_name != NULL) {
- str1 = user1->real_name;
- } else {
- str1 = user1->user_name;
- }
-
- if (user2->real_name != NULL) {
- str2 = user2->real_name;
- } else {
- str2 = user2->user_name;
- }
-
num1 = user1->login_frequency;
num2 = user2->login_frequency;
@@ -388,6 +376,18 @@ gdm_user_collate (GdmUser *user1,
}
/* if login frequency is equal try names */
+ if (user1->real_name != NULL) {
+ str1 = user1->real_name;
+ } else {
+ str1 = user1->user_name;
+ }
+
+ if (user2->real_name != NULL) {
+ str2 = user2->real_name;
+ } else {
+ str2 = user2->user_name;
+ }
+
if (str1 == NULL && str2 != NULL) {
return -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]