[PR #925] [MERGED] Use wstring_view for constants instead of wstring #24401

Closed
opened 2026-01-31 09:03:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/925
Author: @mauve
Created: 5/21/2019
Status: Merged
Merged: 5/21/2019
Merged by: @adiviness

Base: masterHead: master


📝 Commits (1)

  • cd5eac0 Use wstring_view for constants instead of wstring

📊 Changes

9 files changed (+81 additions, -81 deletions)

View changed files

📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+5 -5)
📝 src/cascadia/TerminalApp/ColorScheme.cpp (+4 -4)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+11 -11)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+1 -1)
📝 src/cascadia/TerminalApp/Profile.cpp (+31 -31)
📝 src/cascadia/TerminalApp/Profile.h (+1 -1)
📝 src/host/ConsoleArguments.cpp (+13 -13)
📝 src/host/ConsoleArguments.hpp (+13 -13)
📝 src/host/ut_host/CodepointWidthDetectorTests.cpp (+2 -2)

📄 Description

Instead of creating const static wstring objects which call malloc in the constructor, use wstring_view instead which just wraps the constant.

Summary of the Pull Request

Simple code refactoring.

References

PR Checklist

  • Closes no bug
  • 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

🔄 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/925 **Author:** [@mauve](https://github.com/mauve) **Created:** 5/21/2019 **Status:** ✅ Merged **Merged:** 5/21/2019 **Merged by:** [@adiviness](https://github.com/adiviness) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`cd5eac0`](https://github.com/microsoft/terminal/commit/cd5eac0ca26cbeee4c046484268eba19e8ce1de7) Use wstring_view for constants instead of wstring ### 📊 Changes **9 files changed** (+81 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+5 -5) 📝 `src/cascadia/TerminalApp/ColorScheme.cpp` (+4 -4) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+11 -11) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+1 -1) 📝 `src/cascadia/TerminalApp/Profile.cpp` (+31 -31) 📝 `src/cascadia/TerminalApp/Profile.h` (+1 -1) 📝 `src/host/ConsoleArguments.cpp` (+13 -13) 📝 `src/host/ConsoleArguments.hpp` (+13 -13) 📝 `src/host/ut_host/CodepointWidthDetectorTests.cpp` (+2 -2) </details> ### 📄 Description Instead of creating const static wstring objects which call malloc in the constructor, use wstring_view instead which just wraps the constant. ## Summary of the Pull Request Simple code refactoring. ## References ## PR Checklist * [ ] Closes no bug * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) 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 --- <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:03:06 +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#24401