diff options
-rw-r--r-- | lib/VMCore/Constants.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 22d43a7d58..4c03288fe4 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -666,10 +666,8 @@ Constant *ConstantStruct::get(const StructType *ST, ArrayRef<Constant*> V) { // Create a ConstantAggregateZero value if all elements are zeros. for (unsigned i = 0, e = V.size(); i != e; ++i) - if (!V[i]->isNullValue()) { - // FIXME: Eliminate temporary std::vector here! - return ST->getContext().pImpl->StructConstants.getOrCreate(ST, V.vec()); - } + if (!V[i]->isNullValue()) + return ST->getContext().pImpl->StructConstants.getOrCreate(ST, V); return ConstantAggregateZero::get(ST); } |