[PR #713] [CLOSED] Use operator*() for known non-empty optionals #24264

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/713
Author: @fghzxm
Created: 5/12/2019
Status: Closed

Base: masterHead: push/fix-optional


📝 Commits (2)

  • 850e622 Use operator*() for known non-empty optionals
  • 93dfd53 Catch one more instance of optional::value()

📊 Changes

12 files changed (+49 additions, -49 deletions)

View changed files

📝 src/buffer/out/UnicodeStorage.cpp (+1 -1)
📝 src/buffer/out/textBuffer.cpp (+1 -1)
📝 src/cascadia/TerminalApp/App.cpp (+1 -1)
📝 src/cascadia/TerminalApp/CascadiaSettings.cpp (+1 -1)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+1 -1)
📝 src/cascadia/TerminalApp/Profile.cpp (+12 -12)
📝 src/cascadia/TerminalControl/TermControl.cpp (+4 -4)
📝 src/host/alias.cpp (+14 -14)
📝 src/host/getset.cpp (+4 -4)
📝 src/host/history.cpp (+1 -1)
📝 src/host/ut_host/ApiRoutinesTests.cpp (+8 -8)
📝 src/inc/conpty-universal.h (+1 -1)

📄 Description

This commit changes uses of std::optional::value() to operator*() and
operator->() for optionals known to contain values.

optional::value() throws while operator*() and operator->() do not.
Using the latters should help generating more efficient code at no
maintainability cost.

Signed-off-by: Fred Miller fghzxm@outlook.com


🔄 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/713 **Author:** [@fghzxm](https://github.com/fghzxm) **Created:** 5/12/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `push/fix-optional` --- ### 📝 Commits (2) - [`850e622`](https://github.com/microsoft/terminal/commit/850e622c264d00e6660965fb22d5e54840adadc7) Use operator*() for known non-empty optionals - [`93dfd53`](https://github.com/microsoft/terminal/commit/93dfd531ced2c37dfe41fad33d3130ba3251f907) Catch one more instance of optional::value() ### 📊 Changes **12 files changed** (+49 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/UnicodeStorage.cpp` (+1 -1) 📝 `src/buffer/out/textBuffer.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/App.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettings.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/Profile.cpp` (+12 -12) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+4 -4) 📝 `src/host/alias.cpp` (+14 -14) 📝 `src/host/getset.cpp` (+4 -4) 📝 `src/host/history.cpp` (+1 -1) 📝 `src/host/ut_host/ApiRoutinesTests.cpp` (+8 -8) 📝 `src/inc/conpty-universal.h` (+1 -1) </details> ### 📄 Description This commit changes uses of std::optional::value() to operator*() and operator->() for optionals known to contain values. optional::value() throws while operator*() and operator->() do not. Using the latters should help generating more efficient code at no maintainability cost. Signed-off-by: Fred Miller <fghzxm@outlook.com> --- <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:02:18 +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#24264