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

Shorten the conditionals in apt::source #1214

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Jan 6, 2025

Summary

Rather than writing:

type($release, 'generalized') !~ Type[Array]

This uses:

$release !~ Array

Which is equal, but shorter.

It also refactors some conditionals merge some branches which results in shorter code and arguably easier to read.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Initially introduced in #1167.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@ekohl ekohl requested review from bastelfreak, smortex and a team as code owners January 6, 2025 12:50
@ekohl ekohl force-pushed the simplify-conditionals branch from ba4aec5 to e474dfe Compare January 6, 2025 13:25
Rather than writing:

    type($release, 'generalized') !~ Type[Array]

This uses:

    $release !~ Array

Which is equal, but shorter.

It also refactors some conditionals merge some branches which results in
shorter code and arguably easier to read.
@ekohl ekohl force-pushed the simplify-conditionals branch from e474dfe to 762f688 Compare January 6, 2025 13:55
@bastelfreak bastelfreak merged commit 39adff0 into puppetlabs:main Jan 6, 2025
20 checks passed
@ekohl ekohl deleted the simplify-conditionals branch January 6, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants