[PR #16952] Replace til::some with til::small_vector #31074

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

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

State: closed
Merged: Yes


til::small_vector had a bug: Its internal backing buffer didn't
prevent default initialization! Wrapping it in an union fixed that.

til::some had the same issue, but thinking about it I realized we
don't need both classes to exist, so I removed til::some since
til::small_vector is more flexible.

Checking the assembly, I noticed that til::small_vector with the
union fix produced a more compact result. I also noticed that in
combination with function calls and inlining the bit-wise ANDs in
the point/size/rect boolean operators produced poor-ish results.
Since their impact on performance is negligible to begin with I
simplified that code slightly.

Finally, I noticed that the boolean operator for til::point
was incorrect since it checked for >0 instead of >=0.
Luckily nothing seemed to have used that operator yet.
(= No inbox regression.)

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16952 **State:** closed **Merged:** Yes --- `til::small_vector` had a bug: Its internal backing buffer didn't prevent default initialization! Wrapping it in an `union` fixed that. `til::some` had the same issue, but thinking about it I realized we don't need both classes to exist, so I removed `til::some` since `til::small_vector` is more flexible. Checking the assembly, I noticed that `til::small_vector` with the `union` fix produced a more compact result. I also noticed that in combination with function calls and inlining the bit-wise ANDs in the point/size/rect boolean operators produced poor-ish results. Since their impact on performance is negligible to begin with I simplified that code slightly. Finally, I noticed that the boolean operator for `til::point` was incorrect since it checked for `>0` instead of `>=0`. Luckily nothing seemed to have used that operator yet. (= No inbox regression.)
claunia added the pull-request label 2026-01-31 09:44:54 +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#31074