Fixed clang-tidy warnings
This commit is contained in:
@@ -276,14 +276,14 @@ std::unordered_set<message_chain_t> diagram::get_all_from_to_message_chains(
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (m.to() == to_activity) {
|
if (m.to() == to_activity) {
|
||||||
message_chains.push_back(message_chain_t{});
|
message_chains.emplace_back();
|
||||||
message_chains.back().push_back(m);
|
message_chains.back().push_back(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<int, std::vector<model::message>> calls_to_current_chain;
|
std::map<unsigned int, std::vector<model::message>> calls_to_current_chain;
|
||||||
std::map<int, message_chain_t> current_chain;
|
std::map<unsigned int, message_chain_t> current_chain;
|
||||||
|
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -294,11 +294,11 @@ std::unordered_set<message_chain_t> diagram::get_all_from_to_message_chains(
|
|||||||
if (!calls_to_current_chain.empty()) {
|
if (!calls_to_current_chain.empty()) {
|
||||||
for (auto &[message_chain_index, messages] :
|
for (auto &[message_chain_index, messages] :
|
||||||
calls_to_current_chain) {
|
calls_to_current_chain) {
|
||||||
for (auto i = 0U; i < messages.size(); i++) {
|
for (auto &m : messages) {
|
||||||
message_chains.push_back(
|
message_chains.push_back(
|
||||||
current_chain[message_chain_index]);
|
current_chain[message_chain_index]);
|
||||||
|
|
||||||
message_chains.back().push_back(std::move(messages[i]));
|
message_chains.back().push_back(std::move(m));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
calls_to_current_chain.clear();
|
calls_to_current_chain.clear();
|
||||||
@@ -342,7 +342,7 @@ std::unordered_set<message_chain_t> diagram::get_all_from_to_message_chains(
|
|||||||
// If there are more than one call to the current chain,
|
// If there are more than one call to the current chain,
|
||||||
// duplicate it as many times as there are calls - 1
|
// duplicate it as many times as there are calls - 1
|
||||||
if (calls_to_current_chain.count(i) > 0 &&
|
if (calls_to_current_chain.count(i) > 0 &&
|
||||||
calls_to_current_chain[i].size() >= 1) {
|
!calls_to_current_chain[i].empty()) {
|
||||||
mc.push_back(calls_to_current_chain[i][0]);
|
mc.push_back(calls_to_current_chain[i][0]);
|
||||||
calls_to_current_chain[i].erase(
|
calls_to_current_chain[i].erase(
|
||||||
calls_to_current_chain[i].begin());
|
calls_to_current_chain[i].begin());
|
||||||
|
|||||||
@@ -246,8 +246,8 @@ public:
|
|||||||
* @return List of message chains
|
* @return List of message chains
|
||||||
*/
|
*/
|
||||||
std::unordered_set<message_chain_t> get_all_from_to_message_chains(
|
std::unordered_set<message_chain_t> get_all_from_to_message_chains(
|
||||||
const common::model::diagram_element::id_t from_activity,
|
common::model::diagram_element::id_t from_activity,
|
||||||
const common::model::diagram_element::id_t to_activity) const;
|
common::model::diagram_element::id_t to_activity) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get ids of from and to activities in from_to constraint
|
* @brief Get ids of from and to activities in from_to constraint
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ template <> struct hash<clanguml::sequence_diagram::model::message> {
|
|||||||
std::size_t operator()(
|
std::size_t operator()(
|
||||||
const clanguml::sequence_diagram::model::message &m) const
|
const clanguml::sequence_diagram::model::message &m) const
|
||||||
{
|
{
|
||||||
std::size_t seed = m.from() << 2;
|
std::size_t seed = clanguml::util::hash_seed(m.from());
|
||||||
seed ^= m.to();
|
seed ^= m.to();
|
||||||
seed += std::hash<std::string>{}(m.full_name(true));
|
seed += std::hash<std::string>{}(m.full_name(true));
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ struct hash<std::vector<clanguml::sequence_diagram::model::message>> {
|
|||||||
const std::vector<clanguml::sequence_diagram::model::message> &msgs)
|
const std::vector<clanguml::sequence_diagram::model::message> &msgs)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
std::size_t seed = msgs.size() << 8;
|
std::size_t seed = clanguml::util::hash_seed(msgs.size());
|
||||||
for (const auto &m : msgs) {
|
for (const auto &m : msgs) {
|
||||||
seed ^= std::hash<clanguml::sequence_diagram::model::message>{}(m);
|
seed ^= std::hash<clanguml::sequence_diagram::model::message>{}(m);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user