diff --git a/webserver.c b/webserver.c index 15f214f..4ef27c2 100644 --- a/webserver.c +++ b/webserver.c @@ -82,15 +82,9 @@ uint16_t hash_uri(const char *uri){ #include static bool in_range(uint16_t me, uint16_t suc, uint16_t hash) { - if (me < suc) { - return (hash > me && hash <= suc); - } - elif (me > suc) { - return (hash > me || hash <= suc); - } - else { - return false; - } + if (me < suc) return (hash > me && hash <= suc); + elif (me > suc) return (hash > me || hash <= suc); + else return false; } neighbor check_neighborhood(uint16_t hash) { @@ -98,15 +92,9 @@ neighbor check_neighborhood(uint16_t hash) { uint16_t id = _NODE_ID; uint16_t suc_id = _SUCC_ID; - if (in_range(id, suc_id, hash)) { - return res_303; - } - else if (in_range(pred_id, id, hash)) { - return res; - } - else { - return not_res; - } + if (in_range(id, suc_id, hash)) return res_303; + elif (in_range(pred_id, id, hash)) return res; + else return not_res; }