aboutsummaryrefslogtreecommitdiff
path: root/packet/avrcp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-12-12 14:30:52 -0800
committerChih-Hung Hsieh <chh@google.com>2018-12-12 14:31:36 -0800
commit01a40403d7d5ab4db8f020133ee2918bbcbc3679 (patch)
tree35a2f53b9af9de5f2c095bca7cb1f655bad7d61d /packet/avrcp
parentfef2539cd2fa335e2e420c7a9109ff029d7e68f3 (diff)
downloadbt-01a40403d7d5ab4db8f020133ee2918bbcbc3679.tar.gz
Fix performance-for-range-copy warnings
Bug: 30413223 Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance* Change-Id: I7d5537c24c39d5c42ac17c8a67646e4b9321d6bb
Diffstat (limited to 'packet/avrcp')
-rw-r--r--packet/avrcp/get_element_attributes_packet.cc2
-rw-r--r--packet/avrcp/get_item_attributes.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/packet/avrcp/get_element_attributes_packet.cc b/packet/avrcp/get_element_attributes_packet.cc
index 00ed59694..8634ce079 100644
--- a/packet/avrcp/get_element_attributes_packet.cc
+++ b/packet/avrcp/get_element_attributes_packet.cc
@@ -132,7 +132,7 @@ bool GetElementAttributesResponseBuilder::Serialize(
VendorPacketBuilder::PushHeader(pkt, size() - VendorPacket::kMinSize());
AddPayloadOctets1(pkt, entries_.size());
- for (auto attribute_entry : entries_) {
+ for (const auto& attribute_entry : entries_) {
PushAttributeValue(pkt, attribute_entry);
}
diff --git a/packet/avrcp/get_item_attributes.cc b/packet/avrcp/get_item_attributes.cc
index 145dfed7b..fb2ba875c 100644
--- a/packet/avrcp/get_item_attributes.cc
+++ b/packet/avrcp/get_item_attributes.cc
@@ -70,7 +70,7 @@ bool GetItemAttributesResponseBuilder::Serialize(
if (status_ != Status::NO_ERROR) return true;
AddPayloadOctets1(pkt, entries_.size());
- for (auto entry : entries_) {
+ for (const auto& entry : entries_) {
AddPayloadOctets4(pkt, base::ByteSwap((uint32_t)entry.attribute()));
uint16_t character_set = 0x006a; // UTF-8
AddPayloadOctets2(pkt, base::ByteSwap(character_set));