mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Reduce update-object and inventory update overhead
This commit is contained in:
parent
37888c666d
commit
0631b9f5dc
2 changed files with 71 additions and 48 deletions
|
|
@ -1117,7 +1117,8 @@ bool UpdateObjectParser::parseUpdateFields(network::Packet& packet, UpdateBlock&
|
|||
highestSetBit = fieldIndex;
|
||||
}
|
||||
uint32_t value = packet.readUInt32();
|
||||
block.fields[fieldIndex] = value;
|
||||
// fieldIndex is monotonically increasing here, so end() is a good insertion hint.
|
||||
block.fields.emplace_hint(block.fields.end(), fieldIndex, value);
|
||||
valuesReadCount++;
|
||||
|
||||
LOG_DEBUG(" Field[", fieldIndex, "] = 0x", std::hex, value, std::dec);
|
||||
|
|
@ -1256,7 +1257,7 @@ bool UpdateObjectParser::parse(network::Packet& packet, UpdateObjectData& data)
|
|||
return false;
|
||||
}
|
||||
|
||||
data.blocks.push_back(block);
|
||||
data.blocks.emplace_back(std::move(block));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue