OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 TypeOperations::moveOverlapping(spot + 1, end(), spot); | 1257 TypeOperations::moveOverlapping(spot + 1, end(), spot); |
1258 clearUnusedSlots(end() - 1, end()); | 1258 clearUnusedSlots(end() - 1, end()); |
1259 ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, m_size - 1); | 1259 ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, m_size - 1); |
1260 --m_size; | 1260 --m_size; |
1261 } | 1261 } |
1262 | 1262 |
1263 template<typename T, size_t inlineCapacity, typename Allocator> | 1263 template<typename T, size_t inlineCapacity, typename Allocator> |
1264 inline void Vector<T, inlineCapacity, Allocator>::remove(size_t position, si
ze_t length) | 1264 inline void Vector<T, inlineCapacity, Allocator>::remove(size_t position, si
ze_t length) |
1265 { | 1265 { |
1266 ASSERT_WITH_SECURITY_IMPLICATION(position <= size()); | 1266 ASSERT_WITH_SECURITY_IMPLICATION(position <= size()); |
| 1267 if (!length) |
| 1268 return; |
1267 RELEASE_ASSERT(position + length <= size()); | 1269 RELEASE_ASSERT(position + length <= size()); |
1268 T* beginSpot = begin() + position; | 1270 T* beginSpot = begin() + position; |
1269 T* endSpot = beginSpot + length; | 1271 T* endSpot = beginSpot + length; |
1270 TypeOperations::destruct(beginSpot, endSpot); | 1272 TypeOperations::destruct(beginSpot, endSpot); |
1271 TypeOperations::moveOverlapping(endSpot, end(), beginSpot); | 1273 TypeOperations::moveOverlapping(endSpot, end(), beginSpot); |
1272 clearUnusedSlots(end() - length, end()); | 1274 clearUnusedSlots(end() - length, end()); |
1273 ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, m_size - length); | 1275 ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, m_size - length); |
1274 m_size -= length; | 1276 m_size -= length; |
1275 } | 1277 } |
1276 | 1278 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 struct NeedsTracing<Vector<T, N>> { | 1338 struct NeedsTracing<Vector<T, N>> { |
1337 static const bool value = false; | 1339 static const bool value = false; |
1338 }; | 1340 }; |
1339 #endif | 1341 #endif |
1340 | 1342 |
1341 } // namespace WTF | 1343 } // namespace WTF |
1342 | 1344 |
1343 using WTF::Vector; | 1345 using WTF::Vector; |
1344 | 1346 |
1345 #endif // WTF_Vector_h | 1347 #endif // WTF_Vector_h |
OLD | NEW |