Miscellaneous optimizations to reduce string copying

This commit is contained in:
ridiculousfish
2014-01-07 14:57:58 -08:00
parent cb6be2a50d
commit b34721b3f4
7 changed files with 50 additions and 35 deletions

View File

@@ -892,6 +892,7 @@ int env_set(const wcstring &key, const wchar_t *val, int var_mode)
if (!is_universal)
{
event_t ev = event_t::variable_event(key);
ev.arguments.reserve(3);
ev.arguments.push_back(L"VARIABLE");
ev.arguments.push_back(L"SET");
ev.arguments.push_back(key);