summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 18:26:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 18:26:34 +0100
commitc13bdcefe7ce4974e6d510b38bdca9899e536d56 (patch)
treee5c15f1403ac4604c5fb99cc76835a3b35794896 /src
parent72e3f6532a46b6435b3143ed4d25c825a5fbd477 (diff)
downloadfastd-c13bdcefe7ce4974e6d510b38bdca9899e536d56.tar
fastd-c13bdcefe7ce4974e6d510b38bdca9899e536d56.zip
handshake: get_method() code simplification
Diffstat (limited to 'src')
-rw-r--r--src/handshake.c6
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);