summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2018-01-11 17:10:34 -0500
committerPeter LaFosse <peter@vector35.com>2018-03-23 17:10:06 -0400
commit3190696d1c0d7d94420872202a82a43e03dbcb80 (patch)
tree700b6ef0f675caeae6694997a802feb7385f489d /type.cpp
parent0ad1b8c48a6df3169fc7c80188925b8ef871d112 (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);