net: Hoist now-identical code out of both branches of if
This commit is contained in:
parent
0074d76e44
commit
4488827a39
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue