| 237 | |
| 238 | |
| 239 | inline int HeapList::HeapPush(HeapEntry* item) |
| 240 | { |
| 241 | if (HeapFull()) { |
| 242 | heap_assert(0); // it's possible in theory but not in fact. |
| 243 | return -1; |
| 244 | } |
| 245 | |
| 246 | if (item->GetIndex() != 0) { |
| 247 | heap_assert(0); // duplicated insertion. |
| 248 | return -2; |
| 249 | } |
| 250 | |
| 251 | _count++; |
| 252 | _list[_count] = item; |
| 253 | item->SetIndex(_count); |
| 254 | |
| 255 | HeapUp(); |
| 256 | |
| 257 | return 0; |
| 258 | } |
| 259 | |
| 260 | |
| 261 | inline HeapEntry* HeapList::HeapPop() |
no test coverage detected