Skip to content

Commit

Permalink
[MISC] automatic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
seqan-actions committed Aug 23, 2023
1 parent 1babecf commit 873a978
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ void config::read_from(std::istream & stream)
std::string line;
std::stringstream config_str;

while(std::getline(stream, line) && line != prefix::meta_hibf_config_start);
while (std::getline(stream, line) && line != prefix::meta_hibf_config_start)
;

assert(line == prefix::meta_hibf_config_start);

Expand Down
17 changes: 11 additions & 6 deletions src/detail/layout/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ void hibf::layout::layout::read_from(std::istream & stream)

// parse High Level max bin index
constexpr size_t fullest_tbx_prefix_size = prefix::layout_fullest_technical_bin_idx.size();
assert(line.substr(prefix::layout_top_level.size() + 2, fullest_tbx_prefix_size) == prefix::layout_fullest_technical_bin_idx);
std::string_view const hibf_max_bin_str{line.begin() + prefix::layout_top_level.size() + 2 + fullest_tbx_prefix_size, line.end()};
assert(line.substr(prefix::layout_top_level.size() + 2, fullest_tbx_prefix_size)
== prefix::layout_fullest_technical_bin_idx);
std::string_view const hibf_max_bin_str{line.begin() + prefix::layout_top_level.size() + 2
+ fullest_tbx_prefix_size,
line.end()};
top_level_max_bin_id = parse_first_bin(hibf_max_bin_str);

// read and parse header records, in order to sort them before adding them to the graph
Expand All @@ -106,8 +109,10 @@ void hibf::layout::layout::read_from(std::istream & stream)
line.begin() + 1 /*#*/ + prefix::layout_lower_level.size() + 1 /*_*/,
std::find(line.begin() + prefix::layout_lower_level.size() + 2, line.end(), ' ')};

assert(line.substr(prefix::layout_lower_level.size() + indices_str.size() + 3, fullest_tbx_prefix_size) == prefix::layout_fullest_technical_bin_idx);
std::string_view const max_id_str{line.begin() + prefix::layout_lower_level.size() + indices_str.size() + fullest_tbx_prefix_size + 3,
assert(line.substr(prefix::layout_lower_level.size() + indices_str.size() + 3, fullest_tbx_prefix_size)
== prefix::layout_fullest_technical_bin_idx);
std::string_view const max_id_str{line.begin() + prefix::layout_lower_level.size() + indices_str.size()
+ fullest_tbx_prefix_size + 3,
line.end()};

max_bins.emplace_back(parse_bin_indices(indices_str), parse_first_bin(max_id_str));
Expand All @@ -123,8 +128,8 @@ void hibf::layout::layout::read_from(std::istream & stream)
void hibf::layout::layout::write_to(std::ostream & stream) const
{
// write layout header with max bin ids
stream << prefix::layout_first_header_line << " "
<< prefix::layout_fullest_technical_bin_idx << top_level_max_bin_id << '\n';
stream << prefix::layout_first_header_line << " " << prefix::layout_fullest_technical_bin_idx
<< top_level_max_bin_id << '\n';
for (auto const & max_bin : max_bins)
stream << max_bin << '\n';

Expand Down

0 comments on commit 873a978

Please sign in to comment.