René's URL Explorer Experiment


Title: Refactor complex if statement by xtqqczze · Pull Request #14398 · PowerShell/PowerShell · GitHub

Open Graph Title: Refactor complex if statement by xtqqczze · Pull Request #14398 · PowerShell/PowerShell

X Title: Refactor complex if statement by xtqqczze · Pull Request #14398 · PowerShell/PowerShell

Description: PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

Open Graph Description: While working on #14242, I found a particular complex if statement, so I've refactored it to be more readable. I've split the refactoring into logical steps to to ease review. Contributes t...

X Description: While working on #14242, I found a particular complex if statement, so I've refactored it to be more readable. I've split the refactoring into logical steps to to ease review. Contr...

Opengraph URL: https://github.com/PowerShell/PowerShell/pull/14398

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:01fb2602-7b4c-5c76-5de7-697b5f50f70d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE3C6:31E744:A6DC04:E32FCB:6A52031F
html-safe-noncedabffc24c96513efe4447a619e104c1408a3bbd47c7299eedd690a62e92235d9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0M2OjMxRTc0NDpBNkRDMDQ6RTMyRkNCOjZBNTIwMzFGIiwidmlzaXRvcl9pZCI6Ijc1NTU4NTMzODY4NTMyNTM5MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9707a65754b8cd962c3c07c68ae9d2f2533c93c733b340e9551b9c97dfe468ed
hovercard-subject-tagpull_request:537418388
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/PowerShell/PowerShell/14398/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/c4d6227957557439a9b74c35ae6de44f5a9582aefc6f79b26ab83a8c822b4045/PowerShell/PowerShell/pull/14398
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c4d6227957557439a9b74c35ae6de44f5a9582aefc6f79b26ab83a8c822b4045/PowerShell/PowerShell/pull/14398
og:image:altWhile working on #14242, I found a particular complex if statement, so I've refactored it to be more readable. I've split the refactoring into logical steps to to ease review. Contributes t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamextqqczze
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-cache
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/pull/14398#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F14398
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F14398
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/pull/14398
Reloadhttps://github.com/PowerShell/PowerShell/pull/14398
Reloadhttps://github.com/PowerShell/PowerShell/pull/14398
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/14398
PowerShell https://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Notifications https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Fork 8.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Star 54.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Code https://github.com/PowerShell/PowerShell
Issues 1.3k https://github.com/PowerShell/PowerShell/issues
Pull requests 286 https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality 3 https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Code https://github.com/PowerShell/PowerShell
Issues https://github.com/PowerShell/PowerShell/issues
Pull requests https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
anmenagahttps://github.com/anmenaga
PowerShell:masterhttps://github.com/PowerShell/PowerShell/tree/master
xtqqczze:cond-GetCommandCommandhttps://github.com/xtqqczze/PowerShell-PowerShell/tree/cond-GetCommandCommand
Conversationhttps://github.com/PowerShell/PowerShell/pull/14398
Commits12 (12)https://github.com/PowerShell/PowerShell/pull/14398/commits
Checkshttps://github.com/PowerShell/PowerShell/pull/14398/checks
Files changedhttps://github.com/PowerShell/PowerShell/pull/14398/files
Refactor complex if statementhttps://github.com/PowerShell/PowerShell/pull/14398#top
anmenagahttps://github.com/anmenaga
PowerShell:masterhttps://github.com/PowerShell/PowerShell/tree/master
xtqqczze:cond-GetCommandCommandhttps://github.com/xtqqczze/PowerShell-PowerShell/tree/cond-GetCommandCommand
https://github.com/xtqqczze
xtqqczzehttps://github.com/xtqqczze
Dec 11, 2020https://github.com/PowerShell/PowerShell/pull/14398#issue-762917870
#14242https://github.com/PowerShell/PowerShell/pull/14242
#14242https://github.com/PowerShell/PowerShell/pull/14242
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/14398
xtqqczzehttps://github.com/xtqqczze
December 11, 2020 20:34https://github.com/PowerShell/PowerShell/pull/14398#commits-pushed-e7a0175
https://github.com/xtqqczze
Remove unecessary parenthesishttps://github.com/PowerShell/PowerShell/pull/14398/commits/e7a017589fb43d8b45981fe916fa4afffecc9390
e7a0175https://github.com/PowerShell/PowerShell/pull/14398/commits/e7a017589fb43d8b45981fe916fa4afffecc9390
https://github.com/xtqqczze
Invert ifhttps://github.com/PowerShell/PowerShell/pull/14398/commits/a6ec51e64229ca15da93842c3856bda79e4fcfeb
a6ec51ehttps://github.com/PowerShell/PowerShell/pull/14398/commits/a6ec51e64229ca15da93842c3856bda79e4fcfeb
https://github.com/xtqqczze
Split into consecutive if statementshttps://github.com/PowerShell/PowerShell/pull/14398/commits/dc74a353fcd7536bddfcde2bfb6c14ece1b23c9b
dc74a35https://github.com/PowerShell/PowerShell/pull/14398/commits/dc74a353fcd7536bddfcde2bfb6c14ece1b23c9b
https://github.com/xtqqczze
Inline temporary variablehttps://github.com/PowerShell/PowerShell/pull/14398/commits/c2f539cf348b631e2c6af7d8ea09654fb313180f
c2f539chttps://github.com/PowerShell/PowerShell/pull/14398/commits/c2f539cf348b631e2c6af7d8ea09654fb313180f
https://github.com/xtqqczze
Split into consecutive if statementshttps://github.com/PowerShell/PowerShell/pull/14398/commits/921ad4afca24dd3fe4c5e4d82e44fbbc03e9c74d
921ad4ahttps://github.com/PowerShell/PowerShell/pull/14398/commits/921ad4afca24dd3fe4c5e4d82e44fbbc03e9c74d
https://github.com/xtqqczze
Reorder if statementshttps://github.com/PowerShell/PowerShell/pull/14398/commits/efddec4a0638d507b3a99a2925e9f718f41d8445
efddec4https://github.com/PowerShell/PowerShell/pull/14398/commits/efddec4a0638d507b3a99a2925e9f718f41d8445
https://github.com/xtqqczze
Hoist loop-invariant codehttps://github.com/PowerShell/PowerShell/pull/14398/commits/7313e4e5af68dc5f6ec584a48917a43993603ab7
7313e4ehttps://github.com/PowerShell/PowerShell/pull/14398/commits/7313e4e5af68dc5f6ec584a48917a43993603ab7
https://github.com/xtqqczze
Move iteration variable to left-hand side of expressionshttps://github.com/PowerShell/PowerShell/pull/14398/commits/df55e4d35edc6a88b7c5b3605b135a1ed4be2ac7
df55e4dhttps://github.com/PowerShell/PowerShell/pull/14398/commits/df55e4d35edc6a88b7c5b3605b135a1ed4be2ac7
https://github.com/xtqqczze
Merge with previous if statementhttps://github.com/PowerShell/PowerShell/pull/14398/commits/86439691f7edf8555fcf32589c08ec5e83b61cfb
8643969https://github.com/PowerShell/PowerShell/pull/14398/commits/86439691f7edf8555fcf32589c08ec5e83b61cfb
https://github.com/xtqqczze
Reformathttps://github.com/PowerShell/PowerShell/pull/14398/commits/a495496b68535c70479cff36a2bfa393415639d6
a495496https://github.com/PowerShell/PowerShell/pull/14398/commits/a495496b68535c70479cff36a2bfa393415639d6
https://github.com/xtqqczze
Invert ifhttps://github.com/PowerShell/PowerShell/pull/14398/commits/27191f4c57a15407f995b209eba4b2913aa4f6ad
27191f4https://github.com/PowerShell/PowerShell/pull/14398/commits/27191f4c57a15407f995b209eba4b2913aa4f6ad
https://github.com/xtqqczze
Use pattern matchinghttps://github.com/PowerShell/PowerShell/pull/14398/commits/89fd067eab1b9f2e88088f6c76ac6828ae66ae26
89fd067https://github.com/PowerShell/PowerShell/pull/14398/commits/89fd067eab1b9f2e88088f6c76ac6828ae66ae26
anmenagahttps://github.com/anmenaga
Dec 11, 2020https://github.com/PowerShell/PowerShell/pull/14398#event-4102422485
https://github.com/xtqqczze
xtqqczzehttps://github.com/xtqqczze
Dec 11, 2020 https://github.com/PowerShell/PowerShell/pull/14398#ref-pullrequest-748901738
Enable SA1008: Opening parenthesis should be spaced correctly #14242 https://github.com/PowerShell/PowerShell/pull/14242
https://github.com/iSazonov
iSazonovhttps://github.com/iSazonov
Dec 12, 2020 https://github.com/PowerShell/PowerShell/pull/14398#pullrequestreview-550699977
View reviewed changes https://github.com/PowerShell/PowerShell/pull/14398/files/89fd067eab1b9f2e88088f6c76ac6828ae66ae26
https://github.com/xtqqczze
xtqqczzehttps://github.com/xtqqczze
Dec 12, 2020https://github.com/PowerShell/PowerShell/pull/14398#issuecomment-743910473
#14242https://github.com/PowerShell/PowerShell/pull/14242
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/14398
https://github.com/anmenaga
anmenagahttps://github.com/anmenaga
CL-CodeCleanup https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3ACL-CodeCleanup
Dec 17, 2020https://github.com/PowerShell/PowerShell/pull/14398#event-4122809359
https://github.com/anmenaga
anmenagahttps://github.com/anmenaga
669bcd7https://github.com/PowerShell/PowerShell/commit/669bcd7278ae6663270bd13cf00f8e0d99c1d88a
Dec 17, 2020https://github.com/PowerShell/PowerShell/pull/14398#event-4122810426
https://github.com/xtqqczze
xtqqczzehttps://github.com/xtqqczze
December 17, 2020 01:46https://github.com/PowerShell/PowerShell/pull/14398#event-4122881732
https://github.com/iSazonov
iSazonovhttps://github.com/iSazonov
7.2.0-preview.3https://github.com/PowerShell/PowerShell/milestone/104
Dec 17, 2020https://github.com/PowerShell/PowerShell/pull/14398#event-4123064804
https://github.com/ghost
ghosthttps://github.com/ghost
Feb 12, 2021https://github.com/PowerShell/PowerShell/pull/14398#issuecomment-777920682
Release Noteshttps://github.com/PowerShell/PowerShell/releases/tag/v7.2.0-preview.3
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/14398
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F14398
https://github.com/iSazonov
iSazonov https://github.com/iSazonov
https://github.com/PowerShell/PowerShell/pull/14398/files/89fd067eab1b9f2e88088f6c76ac6828ae66ae26
https://github.com/anmenaga
anmenaga https://github.com/anmenaga
CL-CodeCleanup https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3ACL-CodeCleanup
7.2.0-preview.3 https://github.com/PowerShell/PowerShell/milestone/104
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/14398
https://github.com/xtqqczze
https://github.com/iSazonov
https://github.com/anmenaga
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.