Skip to content

Commit b6093db

Browse files
committed
fix vg prune
1 parent 4a3e464 commit b6093db

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

deps/xg

Submodule xg updated 1 file

src/subcommand/prune_main.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,15 @@ int main_prune(int argc, char** argv) {
313313

314314
// Remove the paths and build an XG index if needed.
315315
if (mode == mode_restore || mode == mode_unfold) {
316-
remove_paths(graph->graph, Paths::is_alt, nullptr);
317-
xg_index.from_handle_graph(*graph);
316+
set<string> alt_path_names;
317+
graph->for_each_path_handle([&](path_handle_t path_handle) {
318+
string path_name = graph->get_path_name(path_handle);
319+
if (Paths::is_alt(path_name)) {
320+
alt_path_names.insert(path_name);
321+
}
322+
});
323+
graph->paths.remove_paths(alt_path_names);
324+
xg_index.from_path_handle_graph(*graph);
318325
if (show_progress) {
319326
std::cerr << "Built a temporary XG index" << std::endl;
320327
}

0 commit comments

Comments
 (0)