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

Core: Avoid redundant links when pasting #1556

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

petersteneteg
Copy link
Member

Fixes #...

Changes proposed in this PR:

  • ...
  • ...
  • ...

This has been tested on: ...

Thank you for contributing to the Inviwo repository! Please ensure the following:

Please remember to specify the environment this code been compiled and tested on:
Operating System / Compiler / IDE / QT / CMake / Python versions.

Copy link

github-actions bot commented Jun 19, 2024

Cpp-Linter Report ✔️

No problems need attention.

Have any feedback or feature suggestions? Share it here.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Cpp-linter Review

Click here for the full clang-tidy patch
diff --git a/src/core/links/linkevaluator.cpp b/src/core/links/linkevaluator.cpp
index 3b95cae..92740d9 100644
--- a/src/core/links/linkevaluator.cpp
+++ b/src/core/links/linkevaluator.cpp
@@ -207 +207 @@ void LinkEvaluator::evaluateLinksFromProperty(Property* modifiedProperty) {
-    VisitedHelper helper(visited_, links);
+    const VisitedHelper helper(visited_, links);

Have any feedback or feature suggestions? Share it here.

src/core/links/linkevaluator.cpp Outdated Show resolved Hide resolved
src/core/links/linkevaluator.cpp Show resolved Hide resolved
src/core/links/linkevaluator.cpp Show resolved Hide resolved
src/core/links/linkevaluator.cpp Show resolved Hide resolved
src/core/links/linkevaluator.cpp Show resolved Hide resolved
src/core/network/autolinker.cpp Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Cpp-linter Review

Click here for the full clang-tidy patch
diff --git a/src/core/links/linkevaluator.cpp b/src/core/links/linkevaluator.cpp
index b6ccd7a..7867fcc 100644
--- a/src/core/links/linkevaluator.cpp
+++ b/src/core/links/linkevaluator.cpp
@@ -178 +178 @@ void LinkEvaluator::transientCacheHelper(std::vector<ConvertibleLink>& links, Pr
-    if (auto converter = manager->getConverter(src, dst)) {
+    if (const auto* converter = manager->getConverter(src, dst)) {
@@ -195,2 +195,2 @@ void LinkEvaluator::transientCacheHelper(std::vector<ConvertibleLink>& links, Pr
-    if (auto cp = dynamic_cast<CompositeProperty*>(dst)) {
-        for (auto& newSrc : cp->getProperties()) {
+    if (auto* cp = dynamic_cast<CompositeProperty*>(dst)) {
+        for (const auto& newSrc : cp->getProperties()) {
diff --git a/src/core/network/autolinker.cpp b/src/core/network/autolinker.cpp
index 09876d9..b990ba5 100644
--- a/src/core/network/autolinker.cpp
+++ b/src/core/network/autolinker.cpp
@@ -72 +72 @@ AutoLinker::AutoLinker(ProcessorNetwork* network, Processor* target, Processor* 
-    for (auto& targetProperty : targetProperties) {
+    for (const auto& targetProperty : targetProperties) {
@@ -98 +98 @@ AutoLinker::AutoLinker(ProcessorNetwork* network, Processor* target, Processor* 
-                return proc && proc->getClassIdentifier() == processorClassId &&
+                return (proc != nullptr) && proc->getClassIdentifier() == processorClassId &&

Have any feedback or feature suggestions? Share it here.

src/core/links/linkevaluator.cpp Outdated Show resolved Hide resolved
src/core/links/linkevaluator.cpp Outdated Show resolved Hide resolved
src/core/network/autolinker.cpp Outdated Show resolved Hide resolved
src/core/network/autolinker.cpp Outdated Show resolved Hide resolved
src/core/network/autolinker.cpp Show resolved Hide resolved
martinfalk
martinfalk previously approved these changes Jun 20, 2024
src/core/links/linkevaluator.cpp Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Cpp-linter Review

No concerns from clang-tidy.

Great job! 🎉

Have any feedback or feature suggestions? Share it here.

@petersteneteg petersteneteg merged commit 17df493 into master Jun 20, 2024
18 checks passed
@petersteneteg petersteneteg deleted the feature/redundant-links branch June 20, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants