Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in overload of addEdge #321

Merged
merged 6 commits into from
Jun 14, 2023

Conversation

sbaldu
Copy link
Collaborator

@sbaldu sbaldu commented Jun 14, 2023

I noticed that there was a bug in the raw pointer overload of addEdge. Since a shared was created from the data of the input edge, the directionality and weight of the input edge were lost.
Now it's fixed.

@sbaldu sbaldu requested a review from ZigRazor June 14, 2023 08:57
@github-actions github-actions bot added core something about core test Something about test labels Jun 14, 2023
@ghost
Copy link

ghost commented Jun 14, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

*
* @param Pointer to the node
*
*/
virtual const std::unordered_set<shared<const Node<T>>, nodeHash<T>> outNeighbors(
shared<const Node<T>> node) const;
virtual const std::unordered_set<shared<const Node<T>>, nodeHash<T>>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
const std::unordered_set<shared<const Node<T>>, nodeHash<T>> Graph<T>::outNeighbors(
const Node<T> *node) const {
const std::unordered_set<shared<const Node<T>>, nodeHash<T>>
Graph<T>::outNeighbors(const Node<T> *node) const {

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 806 with no text in the supplied rule-texts-file

misra violation 806 with no text in the supplied rule-texts-file
@@ -1385,16 +1397,16 @@
}

template <typename T>
const std::unordered_set<shared<const Node<T>>, nodeHash<T>> Graph<T>::outNeighbors(
const Node<T> *node) const {
const std::unordered_set<shared<const Node<T>>, nodeHash<T>>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
auto node_shared = make_shared<const Node<T>>(*node);

return outNeighbors(node_shared);
}

template <typename T>
const std::unordered_set<shared<const Node<T>>, nodeHash<T>> Graph<T>::outNeighbors(
shared<const Node<T>> node) const {
const std::unordered_set<shared<const Node<T>>, nodeHash<T>>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
const std::unordered_set<shared<const Node<T>>, nodeHash<T>> Graph<T>::outNeighbors(
shared<const Node<T>> node) const {
const std::unordered_set<shared<const Node<T>>, nodeHash<T>>
Graph<T>::outNeighbors(shared<const Node<T>> node) const {

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 806 with no text in the supplied rule-texts-file

misra violation 806 with no text in the supplied rule-texts-file
*
* @param Pointer to the node
*
*/
virtual const std::unordered_set<shared<const Node<T>>, nodeHash<T>> outNeighbors(
const Node<T> *node) const;
virtual const std::unordered_set<shared<const Node<T>>, nodeHash<T>>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
const std::unordered_set<shared<const Node<T>>, nodeHash<T>> Graph<T>::outNeighbors(
shared<const Node<T>> node) const {
const std::unordered_set<shared<const Node<T>>, nodeHash<T>>
Graph<T>::outNeighbors(shared<const Node<T>> node) const {

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 508 with no text in the supplied rule-texts-file

misra violation 508 with no text in the supplied rule-texts-file
@ZigRazor ZigRazor merged commit 98432ff into ZigRazor:master Jun 14, 2023
@sbaldu sbaldu deleted the bugfix_rawptr_addedge branch September 27, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core something about core test Something about test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants