mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-11 00:40:04 +02:00
More changes to std::vector usage.
Replace with std::vector with static array, llvm::SmallVector or add code to reserve space.
This commit is contained in:
@@ -165,8 +165,10 @@ void RTTIBuilder::finalize(LLType* type, LLValue* value)
|
||||
|
||||
// set struct body
|
||||
if (st->isOpaque()) {
|
||||
const int n = inits.size();
|
||||
std::vector<LLType*> types;
|
||||
for (int i = 0, n = inits.size(); i < n; ++i)
|
||||
types.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
types.push_back(inits[i]->getType());
|
||||
st->setBody(types);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user