summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2018-01-11 17:10:34 -0500
committerBrian Potchik <brian@vector35.com>2018-01-11 17:10:34 -0500
commit1df49afa5522d73d509d20db9588294fe259085f (patch)
tree089a2ff85c527c485a9d8bd7f3b9c6d234f2fa2f /type.cpp
parentbc779f1e0140a933d65926b9af840a80636a6dd4 (diff)
API Temporary Object Elimination.
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp36
1 files changed, 6 insertions, 30 deletions
diff --git a/type.cpp b/type.cpp
index 40a69ae2..c158f53e 100644
--- a/type.cpp
+++ b/type.cpp
@@ -476,16 +476,8 @@ vector<InstructionTextToken> Type::GetTokens(Platform* platform, uint8_t baseCon
vector<InstructionTextToken> result;
for (size_t i = 0; i < count; i++)
{
- InstructionTextToken token;
- token.type = tokens[i].type;
- token.text = tokens[i].text;
- token.value = tokens[i].value;
- token.size = tokens[i].size;
- token.operand = tokens[i].operand;
- token.context = tokens[i].context;
- token.confidence = tokens[i].confidence;
- token.address = tokens[i].address;
- result.push_back(token);
+ result.emplace_back(tokens[i].type, tokens[i].context, tokens[i].text, tokens[i].address, tokens[i].value, tokens[i].size,
+ tokens[i].operand, tokens[i].confidence);
}
BNFreeTokenList(tokens, count);
@@ -502,16 +494,8 @@ vector<InstructionTextToken> Type::GetTokensBeforeName(Platform* platform, uint8
vector<InstructionTextToken> result;
for (size_t i = 0; i < count; i++)
{
- InstructionTextToken token;
- token.type = tokens[i].type;
- token.text = tokens[i].text;
- token.value = tokens[i].value;
- token.size = tokens[i].size;
- token.operand = tokens[i].operand;
- token.context = tokens[i].context;
- token.confidence = tokens[i].confidence;
- token.address = tokens[i].address;
- result.push_back(token);
+ result.emplace_back(tokens[i].type, tokens[i].context, tokens[i].text, tokens[i].address, tokens[i].value, tokens[i].size,
+ tokens[i].operand, tokens[i].confidence);
}
BNFreeTokenList(tokens, count);
@@ -528,16 +512,8 @@ vector<InstructionTextToken> Type::GetTokensAfterName(Platform* platform, uint8_
vector<InstructionTextToken> result;
for (size_t i = 0; i < count; i++)
{
- InstructionTextToken token;
- token.type = tokens[i].type;
- token.text = tokens[i].text;
- token.value = tokens[i].value;
- token.size = tokens[i].size;
- token.operand = tokens[i].operand;
- token.context = tokens[i].context;
- token.confidence = tokens[i].confidence;
- token.address = tokens[i].address;
- result.push_back(token);
+ result.emplace_back(tokens[i].type, tokens[i].context, tokens[i].text, tokens[i].address, tokens[i].value, tokens[i].size,
+ tokens[i].operand, tokens[i].confidence);
}
BNFreeTokenList(tokens, count);