Skip to content

Commit

Permalink
merge: fixed tool to use sorted index if unsorted is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
bioothod committed Dec 29, 2015
1 parent 60da31f commit 7fccb99
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions example/merge.cpp
Expand Up @@ -78,8 +78,13 @@ struct em_blob {
std::string index_path(path);
index_path += ".index";
index.open(index_path.c_str(), std::ios_base::in | std::ios_base::binary);
if (!index)
throw std::runtime_error("index open failed");
if (!index) {
index_path = std::string(path) + ".index.sorted";
index.open(index_path.c_str(), std::ios_base::in | std::ios_base::binary);
if (!index) {
throw std::runtime_error("index open failed");
}
}
} catch (...) {
data.close();
index.close();
Expand Down

0 comments on commit 7fccb99

Please sign in to comment.