Skip to content

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 a team, bastelfreak and smortex 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants