LSC: Move expensive variables on their last use to avoid copies. This cl was generated with go/gwp-clang-tidy. The following lines are helpful in [determining](http://go/gwp-clang-tidy#metrics-summary) the impact of the change: ``` gwp_clang_tidy_metric: 82.28 gcus gwp_clang_tidy_metric_for_key: 82.28 gcus gwp_clang_tidy_fn_name: http2::HpackDecoderDynamicTable::Insert(std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>) gwp_clang_tidy_num_overlapping_findings: 2 gwp_clang_tidy_call: http2::HpackDecoderDynamicTable::Insert(std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>) -> http2::HpackStringPair::~HpackStringPair() (5.0135 gcus) gwp_clang_tidy_call: http2::HpackDecoderDynamicTable::Insert(std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>) -> quiche::QuicheCircularDeque<http2::HpackStringPair, 3ul, std::__u::allocator<http2::HpackStringPair>>::push_front(http2::HpackStringPair const&) -> ... -> http2::HpackStringPair::HpackStringPair(http2::HpackStringPair const&) (77.2665 gcus) gwp_clang_tidy_type_name: http2::HpackStringPair gwp_clang_tidy_check: google3-runtime-missing-move ``` Tested: TAP train for global presubmit queue http://test/OCL:639793614:BASE:639779627:1717456875696:32a03877 PiperOrigin-RevId: 640138975
diff --git a/quiche/http2/hpack/decoder/hpack_decoder_tables.cc b/quiche/http2/hpack/decoder/hpack_decoder_tables.cc index fdd5cdd..65f7c05 100644 --- a/quiche/http2/hpack/decoder/hpack_decoder_tables.cc +++ b/quiche/http2/hpack/decoder/hpack_decoder_tables.cc
@@ -102,7 +102,7 @@ ++insert_count_; size_t insert_limit = size_limit_ - entry_size; EnsureSizeNoMoreThan(insert_limit); - table_.push_front(entry); + table_.push_front(std::move(entry)); current_size_ += entry_size; QUICHE_DVLOG(2) << "InsertEntry: current_size_=" << current_size_; QUICHE_DCHECK_GE(current_size_, entry_size);