diff --git a/src/db/update/ExcludeList.cxx b/src/db/update/ExcludeList.cxx index e54999f8c..ec44250eb 100644 --- a/src/db/update/ExcludeList.cxx +++ b/src/db/update/ExcludeList.cxx @@ -35,6 +35,18 @@ #include #include +inline void +ExcludeList::ParseLine(char *line) noexcept +{ + char *p = strchr(line, '#'); + if (p != nullptr) + *p = 0; + + p = Strip(line); + if (*p != 0) + patterns.emplace_front(p); +} + bool ExcludeList::LoadFile(Path path_fs) noexcept try { @@ -42,15 +54,8 @@ try { TextFile file(path_fs); char *line; - while ((line = file.ReadLine()) != nullptr) { - char *p = strchr(line, '#'); - if (p != nullptr) - *p = 0; - - p = Strip(line); - if (*p != 0) - patterns.emplace_front(p); - } + while ((line = file.ReadLine()) != nullptr) + ParseLine(line); #else /* not implemented */ (void)path_fs; diff --git a/src/db/update/ExcludeList.hxx b/src/db/update/ExcludeList.hxx index 793a3a162..d27f1c888 100644 --- a/src/db/update/ExcludeList.hxx +++ b/src/db/update/ExcludeList.hxx @@ -69,6 +69,9 @@ public: * the specified file name. */ bool Check(Path name_fs) const noexcept; + +private: + void ParseLine(char *line) noexcept; };