# HG changeset patch # User Ruslan Ermilov # Date 1334226033 0 # Node ID 3d51fa5a110d1e8c4032710c6bd8222135217c2f # Parent a1d5842064f73138548b7a6d827b51c72a2fb7d5 Reduced the number of lines of code in ngx_inet_addr(). diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -44,11 +44,7 @@ ngx_inet_addr(u_char *text, size_t len) return INADDR_NONE; } - if (n != 3) { - return INADDR_NONE; - } - - if (octet < 256) { + if (n == 3 && octet < 256) { addr = (addr << 8) + octet; return htonl(addr); }