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();
|
||||
}
|
||||
|
||||
QStringList commands = commandsStr.split(',', Qt::SkipEmptyParts);
|
||||
for (QString &cmd : commands) {
|
||||
cmd = cmd.trimmed();
|
||||
const QStringList rawCommands = commandsStr.split(',', Qt::SkipEmptyParts);
|
||||
QStringList commands;
|
||||
commands.reserve(rawCommands.size());
|
||||
|
||||
for (const QString &cmd : rawCommands) {
|
||||
commands.append(cmd.trimmed());
|
||||
}
|
||||
|
||||
return commands;
|
||||
|
||||
Reference in New Issue
Block a user