From 42a8a55b51034cf42e516e3ad99c9607277bd89a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 27 Nov 2012 16:14:06 -0800 Subject: [PATCH] Fix setting hotkeys Populating a vector by resizing it to the target size then using push_back does not work very well. --- aegisub/src/hotkey_data_view_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/src/hotkey_data_view_model.cpp b/aegisub/src/hotkey_data_view_model.cpp index e392cd847..84bbf6750 100644 --- a/aegisub/src/hotkey_data_view_model.cpp +++ b/aegisub/src/hotkey_data_view_model.cpp @@ -116,7 +116,7 @@ public: if (col == 0) { wxArrayString toks = wxSplit(variant.GetString(), '-'); std::vector keys; - keys.resize(toks.size()); + keys.reserve(toks.size()); transform(toks.begin(), toks.end(), back_inserter(keys), (std::string(*)(wxString const&))&from_wx); combo = Combo(combo.Context(), combo.CmdName(), keys); cmd_str = combo.Str();