foxygit / doom Log in
commit 4488827a394a8abb086abc068a01865865ffcb13
Author:     Turo Lamminen <turotl@gmail.com>
AuthorDate: Tue Dec 11 19:35:12 2018 +0200
Commit:     Turo Lamminen <turotl@gmail.com>
CommitDate: Tue Dec 11 19:35:12 2018 +0200

    net: Hoist now-identical code out of both branches of if
---
 src/net_sdl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/net_sdl.c b/src/net_sdl.c
index 6f34c466..bfd89279 100644
--- a/src/net_sdl.c
+++ b/src/net_sdl.c
@@ -335,15 +335,14 @@ net_addr_t *NET_SDL_ResolveAddress(char *address)

     colon = strchr(address, ':');

+    addr_hostname = M_StringDuplicate(address);
     if (colon != NULL)
     {
-	addr_hostname = M_StringDuplicate(address);
 	addr_hostname[colon - address] = '\0';
 	addr_port = atoi(colon + 1);
     }
     else
     {
-	addr_hostname = M_StringDuplicate(address);
 	addr_port = port;
     }