mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-12-01 06:52:53 -05:00
refactor: Add reserve size for commands
This commit is contained in:
@ -226,9 +226,12 @@ QStringList ExecuteTerminalCommandTool::getAllowedCommands() const
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList commands = commandsStr.split(',', Qt::SkipEmptyParts);
|
const QStringList rawCommands = commandsStr.split(',', Qt::SkipEmptyParts);
|
||||||
for (QString &cmd : commands) {
|
QStringList commands;
|
||||||
cmd = cmd.trimmed();
|
commands.reserve(rawCommands.size());
|
||||||
|
|
||||||
|
for (const QString &cmd : rawCommands) {
|
||||||
|
commands.append(cmd.trimmed());
|
||||||
}
|
}
|
||||||
|
|
||||||
return commands;
|
return commands;
|
||||||
|
|||||||
Reference in New Issue
Block a user