23 */ |
23 */ |
24 |
24 |
25 #ifndef COMMIT_DATA_H |
25 #ifndef COMMIT_DATA_H |
26 #define COMMIT_DATA_H |
26 #define COMMIT_DATA_H |
27 |
27 |
|
28 #include <map> |
|
29 #include <numeric> |
|
30 #include <vector> |
|
31 #include <string> |
|
32 |
28 namespace fm { |
33 namespace fm { |
29 struct commits final { |
34 struct commits final { |
30 std::vector<std::string> summaries; |
35 std::map< |
31 [[nodiscard]] unsigned count() const {return summaries.size();} |
36 std::string, // repository name |
|
37 std::vector<std::string> > summaries; |
|
38 |
|
39 [[nodiscard]] unsigned count(const std::string &repo) const { |
|
40 return summaries.at(repo).size(); |
|
41 } |
|
42 |
|
43 [[nodiscard]] unsigned count() const { |
|
44 return std::accumulate( |
|
45 summaries.begin(), summaries.end(), 0u, |
|
46 [](unsigned sum, const auto &pair) { return sum + pair.second.size(); }); |
|
47 } |
32 }; |
48 }; |
33 } |
49 } |
34 |
50 |
35 #endif //COMMIT_DATA_H |
51 #endif //COMMIT_DATA_H |