Skip to content

Commit

Permalink
[ci skip] Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel <marehr@users.noreply.github.com>
  • Loading branch information
eseiler and marehr committed Mar 4, 2021
1 parent 2cf2eca commit 69917c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/seqan3/io/sam_file/format_sam_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,17 @@ inline void format_sam_base::read_header(stream_view_type && stream_view,
auto end = std::ranges::end(stream_view);
std::string string_buffer{};

auto call_read_field = [&it, &string_buffer, this] (auto const & predicate, auto & value)
auto take_until_predicate = [&it, &string_buffer, this] (auto const & predicate, auto & value)
{
string_buffer.clear();
while (!predicate(*it))
{
string_buffer.push_back(*it);
++it;
}
read_field(string_buffer, value);
};

auto take_until_colon_and_consume = [&it] ()
auto skip_tag_name_and_colon = [&it] ()
{
while (!is_char<':'>(*it))
++it;
Expand All @@ -482,8 +481,9 @@ inline void format_sam_base::read_header(stream_view_type && stream_view,

auto parse_tag_value = [&] (auto & value) // helper function to parse the next tag value
{
take_until_colon_and_consume();
call_read_field(is_char<'\t'> || is_char<'\n'>, value);
skip_tag_name_and_colon();
take_until_predicate(is_char<'\t'> || is_char<'\n'>, value);
read_field(string_buffer, value);
};

while (it != end && is_char<'@'>(*it))
Expand Down

0 comments on commit 69917c5

Please sign in to comment.