# HG changeset patch # User Teemu Piippo # Date 1418693274 -7200 # Node ID 00a084f8ed26e81c6f3eac562decc638dd277acd # Parent d175243ad1692a714c9c6ebd5f84be0aabf97290 - simplified main() now that RCONSession really cannot ever be null diff -r d175243ad169 -r 00a084f8ed26 sources/main.cpp --- a/sources/main.cpp Tue Dec 16 02:48:18 2014 +0200 +++ b/sources/main.cpp Tue Dec 16 03:27:54 2014 +0200 @@ -64,11 +64,9 @@ timeout.tv_usec = 250000; // 0.25 seconds FD_ZERO (&fdset); FD_SET (0, &fdset); - RCONSession* session = RCONSession::get_session(); - if (session) { - int fd = session->socket()->file_descriptor(); + int fd = RCONSession::get_session()->socket()->file_descriptor(); highest = max (highest, fd); FD_SET (fd, &fdset); } @@ -79,16 +77,12 @@ // stdin is ready, what's incoming? Interface::handle_input(); - if (session) - session->tick(); - + RCONSession::get_session()->tick(); Interface::render(); } } catch (const Exitception&) {} - if (RCONSession::get_session()) - RCONSession::get_session()->disconnect(); - + RCONSession::get_session()->disconnect(); return EXIT_SUCCESS; }