浏览代码

Improve 'if' readability

Abdullah ibn Nadjo 7 年前
父节点
当前提交
6aea2b15bf
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      src/light.c

+ 5
- 1
src/light.c 查看文件

227
 LIGHT_BOOL light_initialize(int argc, char** argv)
227
 LIGHT_BOOL light_initialize(int argc, char** argv)
228
 {
228
 {
229
   int mkdirVal;
229
   int mkdirVal;
230
+  LIGHT_OP_MODE mode;
230
 
231
 
231
   light_defaultConfig();
232
   light_defaultConfig();
232
   if(!light_parseArguments(argc, argv))
233
   if(!light_parseArguments(argc, argv))
234
     LIGHT_ERR("could not parse arguments");
235
     LIGHT_ERR("could not parse arguments");
235
     return FALSE;
236
     return FALSE;
236
   }
237
   }
238
+  mode = light_Configuration.operationMode;
237
 
239
 
238
   /* Just return true for operation modes that do not need initialization */
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
       return TRUE;
245
       return TRUE;
242
   }
246
   }