Skip to content

Commit

Permalink
Fixing clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Jun 19, 2024
1 parent d076d3a commit c3de90b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ jobs:
cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
run_coverage: true
build_type: "Debug"
- name: "Coverage"
- name: "Test"
os: macos-14
cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
run_coverage: true # (this is breaking for some reason @TODO)
cmake_args: "-DCMAKE_BUILD_TYPE=Debug"
build_type: "Debug"
- name: "Live GUI Test"
os: ubuntu-22.04
Expand All @@ -58,10 +57,8 @@ jobs:
build_type: "Debug"
exclude:
# so we don't break GitHub Actions concurrency limit
- name: "Test"
- name: "Coverage"
os: macos-14
# - name: "Coverage"
# os: macos-14
- name: "Coverage"
os: windows-2022

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,16 @@ OptionalRef<ElementType> AbstractTree<ElementType, DerivedType>::findElement (co
}

template <typename ElementType, typename DerivedType>
const OptionalRef<ElementType> AbstractTree<ElementType, DerivedType>::findElement (const ElementType& element) const
OptionalRef<const ElementType> AbstractTree<ElementType, DerivedType>::findElement (const ElementType& element) const
{
return const_cast<AbstractTree&> (*this).findElement (element); // NOSONAR
OptionalRef<const ElementType> result {};
doForAllElements (
[&result, element] (const ElementType& candidate)
{
if (element == candidate)
result = candidate;
});
return result;
}

template <typename ElementType, typename DerivedType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class AbstractTree
[[nodiscard]] OptionalRef<ElementType> findElement (const ElementType& element);

/** Checks if the tree currently contains an element. If true, then return the element, else return nullptr. */
[[nodiscard]] const OptionalRef<ElementType> findElement (const ElementType& element) const;
[[nodiscard]] OptionalRef<const ElementType> findElement (const ElementType& element) const;

template <typename Callable>
void doForAllNodes (Callable&& callable);
Expand Down

0 comments on commit c3de90b

Please sign in to comment.