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

Side by Side Diff: net/quic/interval_set.h

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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 | « net/quic/crypto/strike_register_test.cc ('k') | net/quic/interval_set_test.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // IntervalSet<T> is a data structure used to represent a sorted set of 5 // IntervalSet<T> is a data structure used to represent a sorted set of
6 // non-empty, non-adjacent, and mutually disjoint intervals. Mutations to an 6 // non-empty, non-adjacent, and mutually disjoint intervals. Mutations to an
7 // interval set preserve these properties, altering the set as needed. For 7 // interval set preserve these properties, altering the set as needed. For
8 // example, adding [2, 3) to a set containing only [1, 2) would result in the 8 // example, adding [2, 3) to a set containing only [1, 2) would result in the
9 // set containing the single interval [1, 3). 9 // set containing the single interval [1, 3).
10 // 10 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // 46 //
47 // intervals.Difference(Interval<int>(10, 20)); 47 // intervals.Difference(Interval<int>(10, 20));
48 // // intervals should now contain the single range [20, 40). 48 // // intervals should now contain the single range [20, 40).
49 // EXPECT_EQ(1, intervals.Size()); 49 // EXPECT_EQ(1, intervals.Size());
50 // EXPECT_TRUE(intervals.Contains(Interval<int>(20, 40))); 50 // EXPECT_TRUE(intervals.Contains(Interval<int>(20, 40)));
51 51
52 #ifndef NET_QUIC_INTERVAL_SET_H_ 52 #ifndef NET_QUIC_INTERVAL_SET_H_
53 #define NET_QUIC_INTERVAL_SET_H_ 53 #define NET_QUIC_INTERVAL_SET_H_
54 54
55 #include <stddef.h> 55 #include <stddef.h>
56
56 #include <algorithm> 57 #include <algorithm>
57 #include <set> 58 #include <set>
58 #include <string> 59 #include <string>
59 #include <utility> 60 #include <utility>
60 #include <vector> 61 #include <vector>
61 62
62 #include "base/logging.h" 63 #include "base/logging.h"
63 #include "net/quic/interval.h" 64 #include "net/quic/interval.h"
64 65
65 namespace net { 66 namespace net {
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 template <typename T> 848 template <typename T>
848 inline bool IntervalSet<T>::IntervalComparator::operator()( 849 inline bool IntervalSet<T>::IntervalComparator::operator()(
849 const Interval<T>& a, 850 const Interval<T>& a,
850 const Interval<T>& b) const { 851 const Interval<T>& b) const {
851 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max())); 852 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max()));
852 } 853 }
853 854
854 } // namespace net 855 } // namespace net
855 856
856 #endif // NET_QUIC_INTERVAL_SET_H_ 857 #endif // NET_QUIC_INTERVAL_SET_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/strike_register_test.cc ('k') | net/quic/interval_set_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698