summaryrefslogtreecommitdiff
path: root/interaction.cpp
diff options
context:
space:
mode:
authorScott Lagler <laglerscott@gmail.com>2025-12-12 19:20:21 -0500
committerGlenn Smith <glenn@vector35.com>2025-12-16 17:45:24 -0500
commit6138978808829172448615980742756831959788 (patch)
tree746bb0a634c139967c1755dcbcfb8c3395b97ff5 /interaction.cpp
parent3967000448807875468673398445854536525610 (diff)
Add more reserve calls
Diffstat (limited to 'interaction.cpp')
-rw-r--r--interaction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/interaction.cpp b/interaction.cpp
index c25095bb..afaa2b4a 100644
--- a/interaction.cpp
+++ b/interaction.cpp
@@ -276,6 +276,7 @@ static bool GetChoiceInputCallback(
{
InteractionHandler* handler = (InteractionHandler*)ctxt;
vector<string> choiceStrs;
+ choiceStrs.reserve(count);
for (size_t i = 0; i < count; i++)
choiceStrs.push_back(choices[i]);
return handler->GetChoiceInput(*result, prompt, title, choiceStrs);
@@ -287,6 +288,7 @@ static bool GetLargeChoiceInputCallback(
{
InteractionHandler* handler = (InteractionHandler*)ctxt;
vector<string> choiceStrs;
+ choiceStrs.reserve(count);
for (size_t i = 0; i < count; i++)
choiceStrs.push_back(choices[i]);
return handler->GetLargeChoiceInput(*result, prompt,title, choiceStrs);