summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-06-15 09:28:26 -0700
committerAndroid Code Review <code-review@android.com>2010-06-15 09:28:26 -0700
commit7b67993a9efc90825d42455cc72dd80a3876a2cd (patch)
tree28bfbb7ce5674633706704755ad7d5cb32967c72 /adb
parentb660bfc778470e009c794416562d12395a625ecb (diff)
parent8182829ccb46fc5b043ea258672602dc2928dee2 (diff)
downloadsystem_core-7b67993a9efc90825d42455cc72dd80a3876a2cd.zip
system_core-7b67993a9efc90825d42455cc72dd80a3876a2cd.tar.gz
system_core-7b67993a9efc90825d42455cc72dd80a3876a2cd.tar.bz2
Merge "adb: optimize socket-list-walking code"
Diffstat (limited to 'adb')
-rw-r--r--adb/sockets.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/adb/sockets.c b/adb/sockets.c
index 6d1c89b..43925e4 100644
--- a/adb/sockets.c
+++ b/adb/sockets.c
@@ -65,8 +65,11 @@ asocket *find_local_socket(unsigned id)
asocket *result = NULL;
adb_mutex_lock(&socket_list_lock);
- for(s = local_socket_list.next; s != &local_socket_list && !result; s = s->next) {
- if(s->id == id) result = s;
+ for (s = local_socket_list.next; s != &local_socket_list; s = s->next) {
+ if (s->id == id) {
+ result = s;
+ break;
+ }
}
adb_mutex_unlock(&socket_list_lock);