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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/713

State: closed
Merged: No


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

**Original Pull Request:** https://github.com/microsoft/terminal/pull/713 **State:** closed **Merged:** No --- 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>
claunia added the pull-request label 2026-01-31 09:02:19 +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#24269