the vertex will be placed on top if the vertex didn't exist previewsly in the cache, then miss count is incermented
| 229 | // if the vertex didn't exist previewsly in |
| 230 | // the cache, then miss count is incermented |
| 231 | void AddVertex(unsigned int v) |
| 232 | { |
| 233 | int w = FindVertex(v); |
| 234 | if (w >= 0) |
| 235 | // remove the vertex from the cache (to reinsert it later on the top) |
| 236 | RemoveVertex(w); |
| 237 | else |
| 238 | // the vertex was not found in the cache - increment misses |
| 239 | m_misses++; |
| 240 | |
| 241 | // shift all vertices down (to make room for the new top vertex) |
| 242 | for (int i=39; i>0; i--) |
| 243 | m_cache[i] = m_cache[i-1]; |
| 244 | |
| 245 | // add the new vertex on top |
| 246 | m_cache[0] = v; |
| 247 | } |
| 248 | |
| 249 | void Clear() |
| 250 | { |
no outgoing calls
no test coverage detected