[PR #6548] [MERGED] Optimize booleans #26729

Open
opened 2026-01-31 09:17:48 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6548
Author: @ghost
Created: 6/17/2020
Status: Merged
Merged: 6/22/2020
Merged by: @undefined

Base: masterHead: XOR


📝 Commits (1)

📊 Changes

8 files changed (+16 additions, -18 deletions)

View changed files

📝 samples/ReadConsoleInputStream/ReadConsoleInputStream.cs (+2 -2)
📝 src/cascadia/TerminalApp/WslDistroGenerator.cpp (+2 -2)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp (+4 -4)
📝 src/host/CursorBlinker.cpp (+1 -1)
📝 src/interactivity/onecore/ConIoSrvComm.cpp (+1 -1)
📝 src/tools/U8U16Test/U8U16Test.cpp (+4 -4)
📝 src/tools/U8U16Test/main.cpp (+1 -1)
📝 src/tools/pixels/main.cpp (+1 -3)

📄 Description

Summary of the Pull Request

Many places in this codebase has an equality comparison to the boolean FALSE. This adds unneeded complexity as C and C++ has a NOT operand for use of these in if statements. This makes the code more readable in those areas.

References

PR Checklist

  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

One boolean being compared to FALSE was only used once, with the boolean name being "b", so it is better off not existing at all.

Validation Steps Performed

Unit Testing passed, compiler refactoring


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/6548 **Author:** [@ghost](https://github.com/ghost) **Created:** 6/17/2020 **Status:** ✅ Merged **Merged:** 6/22/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `XOR` --- ### 📝 Commits (1) - [`dbed22a`](https://github.com/microsoft/terminal/commit/dbed22a2ee9afe5a2b1bfb2fe23e3b23004e8054) Optimize booleans ### 📊 Changes **8 files changed** (+16 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `samples/ReadConsoleInputStream/ReadConsoleInputStream.cs` (+2 -2) 📝 `src/cascadia/TerminalApp/WslDistroGenerator.cpp` (+2 -2) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp` (+4 -4) 📝 `src/host/CursorBlinker.cpp` (+1 -1) 📝 `src/interactivity/onecore/ConIoSrvComm.cpp` (+1 -1) 📝 `src/tools/U8U16Test/U8U16Test.cpp` (+4 -4) 📝 `src/tools/U8U16Test/main.cpp` (+1 -1) 📝 `src/tools/pixels/main.cpp` (+1 -3) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Many places in this codebase has an equality comparison to the boolean FALSE. This adds unneeded complexity as C and C++ has a NOT operand for use of these in if statements. This makes the code more readable in those areas. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [X] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments One boolean being compared to FALSE was only used once, with the boolean name being "b", so it is better off not existing at all. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Unit Testing passed, compiler refactoring --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:17:48 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26729