[gdm/accounts-service-split: 14/22] rearrange gdm_user_collate
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/accounts-service-split: 14/22] rearrange gdm_user_collate
- Date: Mon, 7 Jun 2010 22:25:42 +0000 (UTC)
commit ddc1fd619e022a91fdefbf2e6620b33b8f723df2
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
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 4bb2b78..dd10f91 100644
--- a/gui/simple-greeter/gdm-user.c
+++ b/gui/simple-greeter/gdm-user.c
@@ -453,18 +453,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;
g_debug ("Login freq 1=%u 2=%u", (guint)num1, (guint)num2);
@@ -477,6 +465,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]