| OLD | NEW |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Initializes the tree. | 138 // Initializes the tree. |
| 139 void init() { | 139 void init() { |
| 140 // Explicit dereference of "this" required because of | 140 // Explicit dereference of "this" required because of |
| 141 // inheritance rules in template classes. | 141 // inheritance rules in template classes. |
| 142 this->setNeedsFullOrderingComparisons(true); | 142 this->setNeedsFullOrderingComparisons(true); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Starting from the given node, adds all overlaps with the given | 145 // Starting from the given node, adds all overlaps with the given |
| 146 // interval to the result vector. The intervals are sorted by | 146 // interval to the result vector. The intervals are sorted by |
| 147 // increasing low endpoint. | 147 // increasing low endpoint. |
| 148 DISABLE_CFI_PERF |
| 148 template <class AdapterType> | 149 template <class AdapterType> |
| 149 void searchForOverlapsFrom(IntervalNode* node, AdapterType& adapter) const { | 150 void searchForOverlapsFrom(IntervalNode* node, AdapterType& adapter) const { |
| 150 if (!node) | 151 if (!node) |
| 151 return; | 152 return; |
| 152 | 153 |
| 153 // Because the intervals are sorted by left endpoint, inorder | 154 // Because the intervals are sorted by left endpoint, inorder |
| 154 // traversal produces results sorted as desired. | 155 // traversal produces results sorted as desired. |
| 155 | 156 |
| 156 // See whether we need to traverse the left subtree. | 157 // See whether we need to traverse the left subtree. |
| 157 IntervalNode* left = node->left(); | 158 IntervalNode* left = node->left(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 struct ValueToString<PODInterval<T, UserData>> { | 248 struct ValueToString<PODInterval<T, UserData>> { |
| 248 static String toString(const PODInterval<T, UserData>& interval) { | 249 static String toString(const PODInterval<T, UserData>& interval) { |
| 249 return interval.toString(); | 250 return interval.toString(); |
| 250 } | 251 } |
| 251 }; | 252 }; |
| 252 #endif | 253 #endif |
| 253 | 254 |
| 254 } // namespace blink | 255 } // namespace blink |
| 255 | 256 |
| 256 #endif // PODIntervalTree_h | 257 #endif // PODIntervalTree_h |
| OLD | NEW |