From 6dd5d30d57d78603c784a7c678bee65919cf1cc2 Mon Sep 17 00:00:00 2001 From: Thomas Colthurst Date: Thu, 22 Aug 2024 14:40:34 +0000 Subject: [PATCH 1/2] Remove extra newlines --- cxx/util_io.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cxx/util_io.cc b/cxx/util_io.cc index 239feb3..e96b1f5 100644 --- a/cxx/util_io.cc +++ b/cxx/util_io.cc @@ -397,7 +397,7 @@ void to_txt(std::ostream& fp, const IRM& irm, const T_encoding& encoding) { fp << " "; } } - fp << "\n\n"; + fp << "\n"; } } } @@ -418,7 +418,7 @@ void to_txt(std::ostream& fp, const HIRM& hirm, const T_encoding& encoding) { } fp << "\n"; } - fp << "\n\n"; + fp << "\n"; // Write the IRMs. int j = 0; for (const auto& [table, rcs] : tables) { From 5aee8daf1cac83f206e8a4042d2ecea2be5e9ed4 Mon Sep 17 00:00:00 2001 From: Thomas Colthurst Date: Thu, 22 Aug 2024 14:52:16 +0000 Subject: [PATCH 2/2] Changes to loading clusters --- cxx/util_io.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/cxx/util_io.cc b/cxx/util_io.cc index e96b1f5..70f55ce 100644 --- a/cxx/util_io.cc +++ b/cxx/util_io.cc @@ -510,24 +510,15 @@ load_clusters_hirm(const std::string& path) { std::string line; int irmc = 0; - // Only reset the IRM cluster when we see two newlines in a row. - bool start_of_irm_separator = false; while (std::getline(fp, line)) { std::istringstream stream(line); - // Skip a newline. if (line.size() == 0) { - if (start_of_irm_separator) { - irmc = -1; - start_of_irm_separator = false; - } else { - start_of_irm_separator = true; - } + // Start of new IRM + irmc = -1; continue; } - start_of_irm_separator = false; - std::string first; stream >> first;