diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-10-29 18:26:34 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-10-29 18:26:34 +0100 |
commit | c13bdcefe7ce4974e6d510b38bdca9899e536d56 (patch) | |
tree | e5c15f1403ac4604c5fb99cc76835a3b35794896 | |
parent | 72e3f6532a46b6435b3143ed4d25c825a5fbd477 (diff) | |
download | fastd-c13bdcefe7ce4974e6d510b38bdca9899e536d56.tar fastd-c13bdcefe7ce4974e6d510b38bdca9899e536d56.zip |
handshake: get_method() code simplification
-rw-r--r-- | src/handshake.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/handshake.c b/src/handshake.c index 3d10d6b..34807fa 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -298,15 +298,13 @@ static inline const char* get_method(fastd_context_t *ctx, const fastd_handshake fastd_string_stack_t *method_list = parse_string_list(handshake->records[RECORD_METHOD_LIST].data, handshake->records[RECORD_METHOD_LIST].length); const char *method = NULL; - fastd_string_stack_t *method_name = method_list; - while (method_name) { + fastd_string_stack_t *method_name; + for (method_name = method_list; method_name; method_name = method_name->next) { const char *cur_method = method_from_name(ctx, method_name->str, SIZE_MAX); if (cur_method) method = cur_method; - - method_name = method_name->next; } fastd_string_stack_free(method_list); |