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

Side by Side Diff: third_party/WebKit/Source/platform/PODIntervalTree.h

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 PODIntervalSearchAdapter(Vector<IntervalType>& result, 50 PODIntervalSearchAdapter(Vector<IntervalType>& result,
51 const T& lowValue, 51 const T& lowValue,
52 const T& highValue) 52 const T& highValue)
53 : m_result(result), m_lowValue(lowValue), m_highValue(highValue) {} 53 : m_result(result), m_lowValue(lowValue), m_highValue(highValue) {}
54 54
55 const T& lowValue() const { return m_lowValue; } 55 const T& lowValue() const { return m_lowValue; }
56 const T& highValue() const { return m_highValue; } 56 const T& highValue() const { return m_highValue; }
57 void collectIfNeeded(const IntervalType& data) const { 57 void collectIfNeeded(const IntervalType& data) const {
58 if (data.overlaps(m_lowValue, m_highValue)) 58 if (data.overlaps(m_lowValue, m_highValue))
59 m_result.append(data); 59 m_result.push_back(data);
60 } 60 }
61 61
62 private: 62 private:
63 Vector<IntervalType>& m_result; 63 Vector<IntervalType>& m_result;
64 T m_lowValue; 64 T m_lowValue;
65 T m_highValue; 65 T m_highValue;
66 }; 66 };
67 67
68 // An interval tree, which is a form of augmented red-black tree. It 68 // An interval tree, which is a form of augmented red-black tree. It
69 // supports efficient (O(lg n)) insertion, removal and querying of 69 // supports efficient (O(lg n)) insertion, removal and querying of
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 struct ValueToString<PODInterval<T, UserData>> { 248 struct ValueToString<PODInterval<T, UserData>> {
249 static String toString(const PODInterval<T, UserData>& interval) { 249 static String toString(const PODInterval<T, UserData>& interval) {
250 return interval.toString(); 250 return interval.toString();
251 } 251 }
252 }; 252 };
253 #endif 253 #endif
254 254
255 } // namespace blink 255 } // namespace blink
256 256
257 #endif // PODIntervalTree_h 257 #endif // PODIntervalTree_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698