| OLD | NEW | 
|---|
| 1 | 1 | 
| 2 /* | 2 /* | 
| 3  * Copyright 2011 Google Inc. | 3  * Copyright 2011 Google Inc. | 
| 4  * | 4  * | 
| 5  * Use of this source code is governed by a BSD-style license that can be | 5  * Use of this source code is governed by a BSD-style license that can be | 
| 6  * found in the LICENSE file. | 6  * found in the LICENSE file. | 
| 7  */ | 7  */ | 
| 8 #include "SkPtrRecorder.h" | 8 #include "SkPtrRecorder.h" | 
| 9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" | 
| 10 | 10 | 
| 11 SK_DEFINE_INST_COUNT(SkPtrSet) |  | 
| 12 SK_DEFINE_INST_COUNT(SkNamedFactorySet) |  | 
| 13 |  | 
| 14 void SkPtrSet::reset() { | 11 void SkPtrSet::reset() { | 
| 15     Pair* p = fList.begin(); | 12     Pair* p = fList.begin(); | 
| 16     Pair* stop = fList.end(); | 13     Pair* stop = fList.end(); | 
| 17     while (p < stop) { | 14     while (p < stop) { | 
| 18         this->decPtr(p->fPtr); | 15         this->decPtr(p->fPtr); | 
| 19         p += 1; | 16         p += 1; | 
| 20     } | 17     } | 
| 21     fList.reset(); | 18     fList.reset(); | 
| 22 } | 19 } | 
| 23 | 20 | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 68         SkASSERT(array); | 65         SkASSERT(array); | 
| 69         const Pair* p = fList.begin(); | 66         const Pair* p = fList.begin(); | 
| 70         // p->fIndex is base-1, so we need to subtract to find its slot | 67         // p->fIndex is base-1, so we need to subtract to find its slot | 
| 71         for (int i = 0; i < count; i++) { | 68         for (int i = 0; i < count; i++) { | 
| 72             int index = p[i].fIndex - 1; | 69             int index = p[i].fIndex - 1; | 
| 73             SkASSERT((unsigned)index < (unsigned)count); | 70             SkASSERT((unsigned)index < (unsigned)count); | 
| 74             array[index] = p[i].fPtr; | 71             array[index] = p[i].fPtr; | 
| 75         } | 72         } | 
| 76     } | 73     } | 
| 77 } | 74 } | 
| OLD | NEW | 
|---|