[PR #14746] [MERGED] Minor improvements for SplitToOem #30236

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14746
Author: @lhecker
Created: 1/27/2023
Status: Merged
Merged: 2/2/2023
Merged by: @carlos-zamora

Base: mainHead: dev/lhecker/8000-SplitToOem


📝 Commits (1)

  • fa09ecc Minor improvements for SplitToOem

📊 Changes

1 file changed (+13 additions, -16 deletions)

View changed files

📝 src/host/misc.cpp (+13 -16)

📄 Description

When working on #14745 I noticed that SplitToOem was in a bit of a poor state
as well. Instead of simply iterating over its deque argument and writing the
results into a new deque it used pop to advance the head of both queues.
This isn't quite exception safe and rather bloaty. Additionally there's no need
to call WideCharToMultiByte twice on each character if we know that the most
verbose encoding is UTF-8 which can't be any more than 4 chars anyways.

Related to #8000.

PR Checklist

  • 2 unit tests cover this

🔄 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/14746 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 1/27/2023 **Status:** ✅ Merged **Merged:** 2/2/2023 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `main` ← **Head:** `dev/lhecker/8000-SplitToOem` --- ### 📝 Commits (1) - [`fa09ecc`](https://github.com/microsoft/terminal/commit/fa09ecc17f3ccb2b2787fb3065184ce681962002) Minor improvements for SplitToOem ### 📊 Changes **1 file changed** (+13 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/host/misc.cpp` (+13 -16) </details> ### 📄 Description When working on #14745 I noticed that `SplitToOem` was in a bit of a poor state as well. Instead of simply iterating over its `deque` argument and writing the results into a new `deque` it used `pop` to advance the head of both queues. This isn't quite exception safe and rather bloaty. Additionally there's no need to call `WideCharToMultiByte` twice on each character if we know that the most verbose encoding is UTF-8 which can't be any more than 4 chars anyways. Related to #8000. ## PR Checklist * 2 unit tests cover this ✅ --- <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:39:29 +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#30236