Skip to content

Commit

Permalink
Fixes openzim#171 Use findByPath directly
Browse files Browse the repository at this point in the history
  • Loading branch information
maneeshpm committed Jan 25, 2021
1 parent cd7a61d commit 57e2598
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/zimdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,12 @@ void ZimDumper::listEntryT(const zim::Entry& entry)
int ZimDumper::listEntriesByNamespace(const std::string ns, bool details)
{
int ret = 0;
std::string i0char = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (char c:i0char) {
for (auto& entry:m_archive.findByPath(ns + SEPARATOR + std::string(1, c))) {
if (details) {
ret = listEntry(entry);
} else {
std::cout << entry.getPath() << '\n';
}
}
for (auto& entry:m_archive.findByPath(ns)) {
if (details) {
ret = listEntry(entry);
} else {
std::cout << entry.getPath() << '\n';
}
}
return ret;
}
Expand Down

0 comments on commit 57e2598

Please sign in to comment.