Przeglądaj źródła

Improve 'if' readability

Abdullah ibn Nadjo 6 lat temu
rodzic
commit
6aea2b15bf
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5
    1
      src/light.c

+ 5
- 1
src/light.c Wyświetl plik

@@ -227,6 +227,7 @@ void light_printHelp(){
227 227
 LIGHT_BOOL light_initialize(int argc, char** argv)
228 228
 {
229 229
   int mkdirVal;
230
+  LIGHT_OP_MODE mode;
230 231
 
231 232
   light_defaultConfig();
232 233
   if(!light_parseArguments(argc, argv))
@@ -234,9 +235,12 @@ LIGHT_BOOL light_initialize(int argc, char** argv)
234 235
     LIGHT_ERR("could not parse arguments");
235 236
     return FALSE;
236 237
   }
238
+  mode = light_Configuration.operationMode;
237 239
 
238 240
   /* Just return true for operation modes that do not need initialization */
239
-  if(light_Configuration.operationMode == LIGHT_PRINT_HELP || light_Configuration.operationMode == LIGHT_PRINT_VERSION || light_Configuration.operationMode == LIGHT_LIST_CTRL)
241
+  if(mode == LIGHT_PRINT_HELP ||
242
+     mode == LIGHT_PRINT_VERSION ||
243
+     mode == LIGHT_LIST_CTRL)
240 244
   {
241 245
       return TRUE;
242 246
   }