Skip to content

Commit

Permalink
Value initialize to not require fill()
Browse files Browse the repository at this point in the history
  • Loading branch information
glenfe committed Aug 22, 2019
1 parent 1134c88 commit d3b157f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions include/boost/graph/one_bit_color_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ struct one_bit_color_map
typedef read_write_property_map_tag category;

explicit one_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
: n(n), index(index), data(new unsigned char[(n + bits_per_char - 1) / bits_per_char])
: n(n), index(index), data(new unsigned char[(n + bits_per_char - 1) / bits_per_char]())
{
// Fill to white
std::fill(data.get(), data.get() + (n + bits_per_char - 1) / bits_per_char, 0);
}
};

Expand Down
4 changes: 1 addition & 3 deletions include/boost/graph/two_bit_color_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ struct two_bit_color_map
typedef read_write_property_map_tag category;

explicit two_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
: n(n), index(index), data(new unsigned char[(n + elements_per_char - 1) / elements_per_char])
: n(n), index(index), data(new unsigned char[(n + elements_per_char - 1) / elements_per_char]())
{
// Fill to white
std::fill(data.get(), data.get() + (n + elements_per_char - 1) / elements_per_char, 0);
}
};

Expand Down

0 comments on commit d3b157f

Please sign in to comment.