Explorar el Código

Small refactoring

Denis V. Dedkov hace 1 año
padre
commit
6a9381cef9
Se han modificado 1 ficheros con 2 adiciones y 9 borrados
  1. 2 9
      main.cpp

+ 2 - 9
main.cpp

@@ -80,15 +80,8 @@ int main(int argc, char *argv[])
 
     App::srv->set_mount_point("/static", "/var/www/static");
 
-    auto host = App::DefaultHost;
-    auto port = App::DefaultPort;
-
-    if (argc > 1) {
-        host = argv[1];
-    }
-    if (argc > 2) {
-        port = atoi(argv[2]);
-    }
+    auto host = argc > 1 ? argv[1] : App::DefaultHost;
+    auto port = argc > 2 ? atoi(argv[2]) : App::DefaultPort;
 
     std::cout << "Listen on " << host << ":" << port << std::endl;