Added a size check on heap_array<T, CmpT>::Adjust(size_t i) to

prevent access errors.
This commit is contained in:
Robert Osfield
2004-09-07 10:45:22 +00:00
parent bafc126eda
commit 94f1f6025c

View File

@@ -234,7 +234,10 @@ inline void heap_array<T, CmpT>::update(size_t i, const T & Elem) {
template <class T, class CmpT>
inline void heap_array<T, CmpT>::Adjust(size_t i) {
inline void heap_array<T, CmpT>::Adjust(size_t i)
{
if (m_Heap.size()<=1) return; // nothing to swap, so just return.
size_t j;
// Check the upper part of the heap