Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: net/quic/quic_connection.cc

Issue 665823004: Replace calls to set.count() with ContainsKey in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Allow_QUIC_BBR_TCP_sender_to_pace_77668996
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_fec_group.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 ++stats_.packets_revived; 1714 ++stats_.packets_revived;
1715 framer_.ProcessRevivedPacket(&revived_header, 1715 framer_.ProcessRevivedPacket(&revived_header,
1716 StringPiece(revived_payload, len)); 1716 StringPiece(revived_payload, len));
1717 } 1717 }
1718 1718
1719 QuicFecGroup* QuicConnection::GetFecGroup() { 1719 QuicFecGroup* QuicConnection::GetFecGroup() {
1720 QuicFecGroupNumber fec_group_num = last_header_.fec_group; 1720 QuicFecGroupNumber fec_group_num = last_header_.fec_group;
1721 if (fec_group_num == 0) { 1721 if (fec_group_num == 0) {
1722 return nullptr; 1722 return nullptr;
1723 } 1723 }
1724 if (group_map_.count(fec_group_num) == 0) { 1724 if (!ContainsKey(group_map_, fec_group_num)) {
1725 if (group_map_.size() >= kMaxFecGroups) { // Too many groups 1725 if (group_map_.size() >= kMaxFecGroups) { // Too many groups
1726 if (fec_group_num < group_map_.begin()->first) { 1726 if (fec_group_num < group_map_.begin()->first) {
1727 // The group being requested is a group we've seen before and deleted. 1727 // The group being requested is a group we've seen before and deleted.
1728 // Don't recreate it. 1728 // Don't recreate it.
1729 return nullptr; 1729 return nullptr;
1730 } 1730 }
1731 // Clear the lowest group number. 1731 // Clear the lowest group number.
1732 delete group_map_.begin()->second; 1732 delete group_map_.begin()->second;
1733 group_map_.erase(group_map_.begin()); 1733 group_map_.erase(group_map_.begin());
1734 } 1734 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 } 2031 }
2032 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { 2032 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) {
2033 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { 2033 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) {
2034 return true; 2034 return true;
2035 } 2035 }
2036 } 2036 }
2037 return false; 2037 return false;
2038 } 2038 }
2039 2039
2040 } // namespace net 2040 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_fec_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698