Open
Conversation
attempt 1
LostPointer
requested changes
Feb 24, 2024
task_01/src/topology_sort.cpp
Outdated
| @@ -1 +1,16 @@ | |||
| #include "topology_sort.hpp" | |||
|
|
|||
| std::tuple<bool, int *, int *> topology_sort(int *arr, int n, int m) { | |||
Contributor
There was a problem hiding this comment.
имя функции не отображает что она делает, и не в том кодстайле (TopologySort)
task_01/src/topology_sort.cpp
Outdated
| #include "topology_sort.hpp" | ||
|
|
||
| std::tuple<bool, int *, int *> topology_sort(int *arr, int n, int m) { | ||
| int *b = arr, *e = arr + (n - 1); |
Contributor
There was a problem hiding this comment.
b и e плохие названия переменных
task_01/src/topology_sort.cpp
Outdated
|
|
||
| std::tuple<bool, int *, int *> topology_sort(int *arr, int n, int m) { | ||
| int *b = arr, *e = arr + (n - 1); | ||
| bool found = 1; |
LostPointer
requested changes
Mar 2, 2024
task_01/src/topology_sort.cpp
Outdated
| #include "topology_sort.hpp" | ||
|
|
||
| std::tuple<bool, int *, int *> SummanddsInArray(int *arr, int n, int sum) { | ||
| int *begin = arr, *end = arr + (n - 1); |
Contributor
There was a problem hiding this comment.
давай делать так: одна строка одно объявление
task_01/src/topology_sort.cpp
Outdated
| begin++; | ||
| if ((!begin) || (!end) || (begin >= end) || (*begin + *end != sum)) { | ||
| begin = end = nullptr; | ||
| found = 0; |
task_01/src/topology_sort.cpp
Outdated
| @@ -1 +1,16 @@ | |||
| #include "topology_sort.hpp" | |||
|
|
|||
| std::tuple<bool, int *, int *> SummanddsInArray(int *arr, int n, int sum) { | |||
Contributor
There was a problem hiding this comment.
сомнительный конечно тип возвращаемого значения, может тогда лучше std::optional?
LostPointer
requested changes
Mar 23, 2024
Contributor
There was a problem hiding this comment.
давай файл переименуем
Author
|
attempt 4 |
LostPointer
requested changes
Mar 30, 2024
| int m = 11; | ||
| std::optional<std::tuple<int*, int*>> a = SummanddsInArray(arr, n, m); | ||
| ASSERT_TRUE(a); | ||
| ASSERT_EQ(*std::get<0>(a.value()) + *std::get<1>(a.value()), m); |
Contributor
There was a problem hiding this comment.
имхо так лучше выглядит: ASSERT_EQ(*a->first + *a->second, m);
LostPointer
reviewed
May 4, 2024
task_01/src/summandds_in_array.hpp
Outdated
| @@ -0,0 +1,9 @@ | |||
| #ifndef TOPOLOGY_SORT_HPP | |||
| #define TOPOLOGY_SORT_HPP | |||
Contributor
There was a problem hiding this comment.
давай в соответствии с именем файла переименуем
now it's SUMMANDDS_IN_ARRAY_HPP
LostPointer
approved these changes
Jun 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
attempt 1