Move spv_instruction_t's into vector
authorChris Forbes <chrisforbes@google.com>
Tue, 27 Jun 2017 21:21:00 +0000 (14:21 -0700)
committerDavid Neto <dneto@google.com>
Wed, 28 Jun 2017 15:13:26 +0000 (11:13 -0400)
No need to incur another copy here. These guys have embedded vectors
we'd rather not copy.

source/validate.cpp

index cf86478..ad0fbb9 100644 (file)
@@ -328,7 +328,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
     spv_instruction_t inst;
     spvInstructionCopy(&binary->code[index], static_cast<SpvOp>(opcode),
                        wordCount, endian, &inst);
-    instructions.push_back(inst);
+    instructions.emplace_back(std::move(inst));
     index += wordCount;
   }