mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 13:47:46 +00:00
General: Replace loop with resize where applicable
Instead of default constructing in a loop for std::vector, we can just use resize or its size constructor to do the same thing.
This commit is contained in:
@@ -20,11 +20,9 @@ void Toolbar::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const ITh
|
||||
Toolbar::Toolbar(ViewResources& res, View& parentView, Position tbPos, unsigned units)
|
||||
: View(res, parentView)
|
||||
, m_units(units)
|
||||
, m_children(units)
|
||||
, m_nomGauge(res.pixelFactor() * SPECTER_TOOLBAR_GAUGE * units)
|
||||
, m_padding(res.pixelFactor() * TOOLBAR_PADDING) {
|
||||
m_children.reserve(units);
|
||||
for (unsigned u = 0; u < units; ++u)
|
||||
m_children.emplace_back();
|
||||
commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool {
|
||||
buildResources(ctx, res);
|
||||
m_tbBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory);
|
||||
|
||||
Reference in New Issue
Block a user