Use a better function to read through files

This commit is contained in:
topjohnwu
2019-02-17 22:30:23 -05:00
parent fb55fe184c
commit 14aa6041ec
5 changed files with 49 additions and 51 deletions
+4 -3
View File
@@ -263,9 +263,10 @@ bool init_list() {
// Migrate old hide list into database
if (access(LEGACY_LIST, R_OK) == 0) {
auto tmp = file_to_vector(LEGACY_LIST);
for (auto &s : tmp)
add_list(s.c_str());
file_readline(LEGACY_LIST, [](string_view &s) -> bool {
add_list(s.data());
return true;
});
unlink(LEGACY_LIST);
}