Skip to content

Kirill Yartsev - #26

Open
yunhkirill wants to merge 1 commit into
DafeMipt213:mainfrom
yunhkirill:main
Open

Kirill Yartsev#26
yunhkirill wants to merge 1 commit into
DafeMipt213:mainfrom
yunhkirill:main

Conversation

@yunhkirill

Copy link
Copy Markdown

No description provided.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 54. Check the log or trigger a new build to see more.

Comment thread task_01/src/test.cpp
@@ -1,8 +1,84 @@

#include <gtest/gtest.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]

#include <gtest/gtest.h>
         ^

Comment thread task_01/src/test.cpp

TEST(TopologySort, Simple) {
ASSERT_EQ(1, 1); // Stack []
int vertices = 4;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int vertices = 4;
int const vertices = 4;

Comment thread task_01/src/test.cpp
}

TEST(TopologySort, SimpleCycle) {
int vertices = 4;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int vertices = 4;
int const vertices = 4;

Comment thread task_01/src/test.cpp
}

TEST(TopologySort, Medium) {
int vertices = 6;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int vertices = 6;
int const vertices = 6;

Comment thread task_01/src/test.cpp
}

TEST(TopologySort, Hard) {
int vertices = 9;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int vertices = 9;
int const vertices = 9;

Comment thread task_03/src/johnson.cpp

for (int u = 0; u < weight_adjacency_list_.size(); ++u)
for (const auto& edge : weight_adjacency_list_[u]) {
int v = edge.first;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'v' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int v = edge.first;
int const v = edge.first;

Comment thread task_03/src/johnson.cpp
for (int u = 0; u < weight_adjacency_list_.size(); ++u)
for (const auto& edge : weight_adjacency_list_[u]) {
int v = edge.first;
int weight = edge.second;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'weight' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int weight = edge.second;
int const weight = edge.second;

Comment thread task_03/src/johnson.cpp
pq.push({0, source});

while (!pq.empty()) {
int u = pq.top().second;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'u' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int u = pq.top().second;
int const u = pq.top().second;

Comment thread task_03/src/johnson.cpp
pq.pop();

for (const auto& edge : weight_adjacency_list_[u]) {
int v = edge.first;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'v' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int v = edge.first;
int const v = edge.first;

Comment thread task_03/src/johnson.cpp

for (const auto& edge : weight_adjacency_list_[u]) {
int v = edge.first;
int weight = edge.second;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'weight' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int weight = edge.second;
int const weight = edge.second;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant