. - #24
Conversation
| marks_[elem] = Color::White; | ||
| } | ||
|
|
||
| void Graph::DFS(int u, std::function<void(int)> action, bool is_clean_marks) { |
There was a problem hiding this comment.
warning: the parameter 'action' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
lib/src/graph.hpp:19:
- void DFS(int u, std::function<void(int)> action, bool is_clean_marks = true);
+ void DFS(int u, const std::function<void(int)>& action, bool is_clean_marks = true);| void Graph::DFS(int u, std::function<void(int)> action, bool is_clean_marks) { | |
| void Graph::DFS(int u, const std::function<void(int)>& action, bool is_clean_marks) { |
| } | ||
|
|
||
| std::map<int, std::vector<std::pair<int, int>>> Graph::Johnson() { | ||
| int s = -inf; |
There was a problem hiding this comment.
warning: variable 's' of type 'int' can be declared 'const' [misc-const-correctness]
| int s = -inf; | |
| int const s = -inf; |
| void Add(int elem, int parent, int weight = 1); | ||
| bool IsCycle(); | ||
| bool Find(int elem); | ||
| int Size() { return graph_.size(); } |
There was a problem hiding this comment.
warning: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
int Size() { return graph_.size(); }
^| return (i - 1) / 2; | ||
| } | ||
| size_t LeftChld(size_t i) { | ||
| size_t inf = std::numeric_limits<int>::infinity() + 1; |
There was a problem hiding this comment.
warning: variable 'inf' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| size_t inf = std::numeric_limits<int>::infinity() + 1; | |
| size_t const inf = std::numeric_limits<int>::infinity() + 1; |
| return 2 * i + 1; | ||
| } | ||
| size_t RightChld(size_t i) { | ||
| size_t inf = std::numeric_limits<int>::infinity() + 1; |
There was a problem hiding this comment.
warning: variable 'inf' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| size_t inf = std::numeric_limits<int>::infinity() + 1; | |
| size_t const inf = std::numeric_limits<int>::infinity() + 1; |
| int Recursion(BinTree t, size_t l, size_t m, size_t i) { | ||
| if (t.LeftChld(i) >= l && t.RightChld(i) <= m) | ||
| return t.data_[i]; | ||
| int inf = std::numeric_limits<int>::infinity() + 1; |
There was a problem hiding this comment.
warning: variable 'inf' of type 'int' can be declared 'const' [misc-const-correctness]
| int inf = std::numeric_limits<int>::infinity() + 1; | |
| int const inf = std::numeric_limits<int>::infinity() + 1; |
| @@ -0,0 +1,3 @@ | |||
| #include "/workspaces/algorithms_2nd/lib/src/tree.hpp" | |||
There was a problem hiding this comment.
warning: '/workspaces/algorithms_2nd/lib/src/tree.hpp' file not found [clang-diagnostic-error]
#include "/workspaces/algorithms_2nd/lib/src/tree.hpp"
^| @@ -1,6 +1,14 @@ | |||
|
|
|||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^| @@ -0,0 +1,3 @@ | |||
| #include "/workspaces/algorithms_2nd/task_05/src/rmq.hpp" | |||
There was a problem hiding this comment.
warning: '/workspaces/algorithms_2nd/task_05/src/rmq.hpp' file not found [clang-diagnostic-error]
#include "/workspaces/algorithms_2nd/task_05/src/rmq.hpp"
^| @@ -1,6 +1,11 @@ | |||
|
|
|||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
1 commit