Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Takatoshi Kondo <redboltz@gmail.com>
  • Loading branch information
kleunen and redboltz authored Nov 29, 2020
1 parent d713875 commit 420714f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/retained_topic_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(erase_upper_first) {
}

BOOST_AUTO_TEST_CASE(large_number_of_topics) {
retained_topic_map< std::pair<std::size_t, std::size_t> > map;
retained_topic_map<std::pair<std::size_t, std::size_t>> map;

std::vector< std::pair<std::string, std::pair<std::size_t, std::size_t> > > created_topics;

Expand Down
8 changes: 4 additions & 4 deletions test/retained_topic_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class retained_topic_map {

// Increase the count for this node
void increase_count() {
if(count == max_count) {
if (count == max_count) {
throw_max_stored_topics();
}

Expand Down Expand Up @@ -117,7 +117,7 @@ class retained_topic_map {
}
}
else {
direct_index.modify(entry, [](path_entry &entry){ entry.increase_count(); });
direct_index.modify(entry, [](path_entry& entry){ entry.increase_count(); });
}

parent = entry;
Expand Down Expand Up @@ -249,7 +249,7 @@ class retained_topic_map {

// Do iterators stay valid when erasing ? I think they do ?
for (auto entry : path) {
direct_index.modify(entry, [](path_entry &entry){ entry.decrease_count(); });
direct_index.modify(entry, [](path_entry& entry){ entry.decrease_count(); });

if (entry->count == 0) {
map.erase(entry);
Expand All @@ -267,7 +267,7 @@ class retained_topic_map {
auto& direct_index = map.template get<direct_index_tag>();

for(auto& i : path) {
direct_index.modify(i, [](path_entry &entry){ entry.increase_count(); });
direct_index.modify(i, [](path_entry& entry){ entry.increase_count(); });
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/subscription_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class subscription_map_base {
}

// Decrease the subscription count for a specific node
static void decrease_count_storage(count_storage_t &count) {
static void decrease_count_storage(count_storage_t& count) {
BOOST_ASSERT(count.value() > 0);
count.decrement_value();
}
Expand Down

0 comments on commit 420714f

Please sign in to comment.