| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012,2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2012,2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 this->setCachedNodeCount(m_cachedList.size()); | 99 this->setCachedNodeCount(m_cachedList.size()); |
| 100 m_listValid = true; | 100 m_listValid = true; |
| 101 return this->cachedNodeCount(); | 101 return this->cachedNodeCount(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 template <typename Collection, typename NodeType> | 104 template <typename Collection, typename NodeType> |
| 105 inline NodeType* CollectionItemsCache<Collection, NodeType>::nodeAt(const Collec
tion& collection, unsigned index) | 105 inline NodeType* CollectionItemsCache<Collection, NodeType>::nodeAt(const Collec
tion& collection, unsigned index) |
| 106 { | 106 { |
| 107 if (m_listValid) { | 107 if (m_listValid) { |
| 108 ASSERT(this->isCachedNodeCountValid()); | 108 DCHECK(this->isCachedNodeCountValid()); |
| 109 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr; | 109 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr; |
| 110 } | 110 } |
| 111 return Base::nodeAt(collection, index); | 111 return Base::nodeAt(collection, index); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif // CollectionItemsCache_h | 116 #endif // CollectionItemsCache_h |
| OLD | NEW |