ConfigParser: simplify empty line check
[ncmpc-debian.git] / src / ConfigParser.cxx
index 8b434f8..8a90a5e 100644 (file)
@@ -652,18 +652,18 @@ ReadConfigFile(const char *filename)
        while (fgets(line, sizeof(line), file) != nullptr) {
                ++no;
                char *p = StripLeft(line);
        while (fgets(line, sizeof(line), file) != nullptr) {
                ++no;
                char *p = StripLeft(line);
-
-               if (*p != 0 && *p != COMMENT_TOKEN) {
-                       StripRight(p);
-
-                       try {
-                               parse_line(p);
-                       } catch (...) {
-                               fprintf(stderr,
-                                       "Failed to parse '%s' line %u: ",
-                                       filename, no);
-                               PrintException(std::current_exception());
-                       }
+               if (*p == 0 || *p == COMMENT_TOKEN)
+                       continue;
+
+               StripRight(p);
+
+               try {
+                       parse_line(p);
+               } catch (...) {
+                       fprintf(stderr,
+                               "Failed to parse '%s' line %u: ",
+                               filename, no);
+                       PrintException(std::current_exception());
                }
        }
 
                }
        }