Commit 6891a21c authored by Anonymous's avatar Anonymous

Clang-tidy modification

parent 55dd8372
...@@ -8,14 +8,14 @@ using namespace std; ...@@ -8,14 +8,14 @@ using namespace std;
std::string std::string
MSetOcc::txt (const std::vector<std::string>& events, bool empty) const { MSetOcc::txt (const std::vector<std::string>& events, bool empty) const {
ostringstream os; ostringstream os;
std::vector<std::pair<bool,bool>>* disc = NULL; std::vector<std::pair<bool,bool>>* disc = nullptr;
if (empty) disc = new std::vector<std::pair<bool,bool>>((_elements.size()*(_elements.size()-1))/2,std::pair<bool,bool>(false,false)); if (empty) disc = new std::vector<std::pair<bool,bool>>((_elements.size()*(_elements.size()-1))/2,std::pair<bool,bool>(false,false));
if (_prefs.size() == 0) { if (_prefs.empty()) {
std::vector<TCIterator> tcs; std::vector<TCIterator> tcs;
for (unsigned i = 0; i < _occurrences.size(); i++) { for (const auto &_occurrence : _occurrences) {
TC *tc = new TC(_occurrences[i][0].first, TC *tc = new TC(_occurrence[0].first,
_occurrences[i][_occurrences[i].size() - 1].first); _occurrence[_occurrence.size() - 1].first);
tcs.push_back(TCIterator(std::shared_ptr<TC>(tc), true)); tcs.emplace_back(std::shared_ptr<TC>(tc), true);
} }
if (empty) tcs = std::vector<TCIterator>(disc->size()); if (empty) tcs = std::vector<TCIterator>(disc->size());
os << Chronicle(_elements, tcs, frequency, ofrequency).txt(events,disc); os << Chronicle(_elements, tcs, frequency, ofrequency).txt(events,disc);
...@@ -29,7 +29,7 @@ MSetOcc::txt (const std::vector<std::string>& events, bool empty) const { ...@@ -29,7 +29,7 @@ MSetOcc::txt (const std::vector<std::string>& events, bool empty) const {
TC *tc = new TC(_occurrences[i][begin].first, TC *tc = new TC(_occurrences[i][begin].first,
_occurrences[i][end].first); _occurrences[i][end].first);
tcs.push_back(TCIterator(std::shared_ptr<TC>(tc), true)); tcs.emplace_back(std::shared_ptr<TC>(tc), true);
} }
os << Chronicle(_elements, tcs, frequency, ofrequency).txt(events,disc); os << Chronicle(_elements, tcs, frequency, ofrequency).txt(events,disc);
} }
...@@ -48,7 +48,7 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co ...@@ -48,7 +48,7 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co
os << "{\"nodes\": ["; os << "{\"nodes\": [";
for (int i = 0; i < nb_e; i++) { for (int i = 0; i < nb_e; i++) {
int e = _elements[i]; int e = _elements[i];
os << "{\"id\": \"" << i <<"\", \"label\": \""<< events[e] << "\"}"; os << R"({"id": ")" << i << R"(", "label": ")" << events[e] << "\"}";
if (i+1 < nb_e) os << ","; if (i+1 < nb_e) os << ",";
} }
...@@ -76,19 +76,19 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co ...@@ -76,19 +76,19 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co
} }
os << "]"; os << "]";
} }
os << "}, \"frequency\": \"" << frequency << "\"}" << std::endl; os << R"(}, "frequency": ")" << frequency << "\"}" << std::endl;
return os.str(); return os.str();
} }
ostringstream os; ostringstream os;
if (_prefs.size() == 0) { if (_prefs.empty()) {
std::vector<TCIterator> tcs; std::vector<TCIterator> tcs;
for (unsigned i = 0; i < _occurrences.size(); i++) { for (const auto &_occurrence : _occurrences) {
TC *tc = new TC(_occurrences[i][0].first, TC *tc = new TC(_occurrence[0].first,
_occurrences[i][_occurrences[i].size() - 1].first); _occurrence[_occurrence.size() - 1].first);
tcs.push_back(TCIterator(std::shared_ptr<TC>(tc), true)); tcs.emplace_back(std::shared_ptr<TC>(tc), true);
} }
os << Chronicle(_elements, tcs, frequency, ofrequency).json(events); os << Chronicle(_elements, tcs, frequency, ofrequency).json(events);
...@@ -103,7 +103,7 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co ...@@ -103,7 +103,7 @@ MSetOcc::json (const std::vector<std::string>& events, const bool& chronicle) co
TC *tc = new TC(_occurrences[i][begin].first, TC *tc = new TC(_occurrences[i][begin].first,
_occurrences[i][end].first); _occurrences[i][end].first);
tcs.push_back(TCIterator(std::shared_ptr<TC>(tc), true)); tcs.emplace_back(std::shared_ptr<TC>(tc), true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment