CTweakEditor: Make use of STL equivalents over << where applicable

More recognizable with regards to behavior being performed.

While we're at it, we can preallocate the backing asset QVector ahead of
time.
This commit is contained in:
Lioncash 2020-07-05 10:03:50 -04:00
parent d235fd4b17
commit fdcb0b770c
2 changed files with 10 additions and 4 deletions

View File

@ -116,9 +116,12 @@ void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
// Create tweak list
if (pNewProject != nullptr)
{
for (CTweakData* pTweakData : pNewProject->TweakManager()->TweakObjects())
const auto& tweakObjects = pNewProject->TweakManager()->TweakObjects();
mTweakAssets.reserve(static_cast<int>(tweakObjects.size()));
for (CTweakData* tweakData : tweakObjects)
{
mTweakAssets << pTweakData;
mTweakAssets.push_back(tweakData);
}
}

View File

@ -59,8 +59,11 @@ CWorldEditor::CWorldEditor(QWidget *parent)
ui->ResourceBrowserContainer->setLayout(pLayout);
// Initialize splitter
QList<int> SplitterSizes;
SplitterSizes << width() * 0.25 << width() * 0.53 << width() * 0.22;
const QList<int> SplitterSizes{
static_cast<int>(width() * 0.25),
static_cast<int>(width() * 0.53),
static_cast<int>(width() * 0.22),
};
ui->splitter->setSizes(SplitterSizes);
// Initialize UI stuff