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

Avoid double negations to check for cancellation #83

Closed
LeonNissen opened this issue Dec 18, 2024 · 1 comment
Closed

Avoid double negations to check for cancellation #83

LeonNissen opened this issue Dec 18, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@LeonNissen
Copy link
Contributor

LeonNissen commented Dec 18, 2024

Refactor the check for cancellation checkCancellation so that we don't have a double negation (guard & !), throughout the whole framework.

I usually try to void double negations since they make the code harder to read. Instead we can use if.

Originally posted by @jdisho in #81 (comment)

@LeonNissen LeonNissen added the good first issue Good for newcomers label Dec 18, 2024
philippzagar pushed a commit that referenced this issue Feb 15, 2025
# Remove double negations for `checkCancellation` function


## ♻️ Current situation & Problem

As mentionned in issue #83 as well as in the PR [#81
(discussion)](#81 (comment)),
the SpeziLLM package is currently using a double negation (`guard`
followed by `!`) for every `checkCancellation()` function call. As
double negations make the code harder to read, we could use `if`
instead.

## ⚙️ Release Notes 
* Remove the double negations for `checkCancellation` by replacing the
`guard` statements that are followed by a not operator into an `if`
statement.

## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
@philippzagar
Copy link
Member

Closed by #98

@github-project-automation github-project-automation bot moved this from Backlog to Done in Project Planning Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

No branches or pull requests

2 participants