diff options
author | Volker Lendecke <vl@samba.org> | 2009-12-06 12:49:46 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-12-06 13:07:04 +0100 |
commit | 1ba91c0a51e173bbf6616b2bb4ea778acd0c5dc8 (patch) | |
tree | ea109fbffe18513f212e8a5a29f21973a97e6aa7 | |
parent | 449045e75d7920b7bb20f8445aadff783ddbfd0c (diff) | |
download | samba-1ba91c0a51e173bbf6616b2bb4ea778acd0c5dc8.tar.gz samba-1ba91c0a51e173bbf6616b2bb4ea778acd0c5dc8.tar.bz2 samba-1ba91c0a51e173bbf6616b2bb4ea778acd0c5dc8.zip |
s3: Small simplification: qsort deals fine with just one entry
-rw-r--r-- | source3/rpc_server/srv_wkssvc_nt.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c index 8a8551cc24..d5df0da849 100644 --- a/source3/rpc_server/srv_wkssvc_nt.c +++ b/source3/rpc_server/srv_wkssvc_nt.c @@ -104,10 +104,7 @@ static char **get_logged_on_userlist(TALLOC_CTX *mem_ctx) } /* Sort the user list by time, oldest first */ - if (num_users > 1) { - qsort(usr_infos, num_users, sizeof(struct usrinfo), - usr_info_cmp); - } + qsort(usr_infos, num_users, sizeof(struct usrinfo), usr_info_cmp); users = (char**)talloc_array(mem_ctx, char*, num_users); if (users) { @@ -238,9 +235,7 @@ static struct dom_usr *get_domain_userlist(TALLOC_CTX *mem_ctx) users = tmp; /* Sort the user list by time, oldest first */ - if (num_users > 1) { - qsort(users, num_users, sizeof(struct dom_usr), dom_user_cmp); - } + qsort(users, num_users, sizeof(struct dom_usr), dom_user_cmp); errno = 0; return users; |