kernel/util: Make MinMaxHeap::Peek*() const

This commit is contained in:
Pawel Dziepak
2013-12-23 03:52:13 +01:00
parent 5a69ffc01e
commit 3309bf33c7
+4 -4
View File
@@ -73,8 +73,8 @@ public:
MinMaxHeap(int initialSize); MinMaxHeap(int initialSize);
~MinMaxHeap(); ~MinMaxHeap();
inline Element* PeekMinimum(); inline Element* PeekMinimum() const;
inline Element* PeekMaximum(); inline Element* PeekMaximum() const;
static const Key& GetKey(Element* element); static const Key& GetKey(Element* element);
@@ -190,7 +190,7 @@ MIN_MAX_HEAP_CLASS_NAME::~MinMaxHeap()
MIN_MAX_HEAP_TEMPLATE_LIST MIN_MAX_HEAP_TEMPLATE_LIST
Element* Element*
MIN_MAX_HEAP_CLASS_NAME::PeekMinimum() MIN_MAX_HEAP_CLASS_NAME::PeekMinimum() const
{ {
if (fMinLastElement > 0) if (fMinLastElement > 0)
return fMinElements[0]; return fMinElements[0];
@@ -205,7 +205,7 @@ MIN_MAX_HEAP_CLASS_NAME::PeekMinimum()
MIN_MAX_HEAP_TEMPLATE_LIST MIN_MAX_HEAP_TEMPLATE_LIST
Element* Element*
MIN_MAX_HEAP_CLASS_NAME::PeekMaximum() MIN_MAX_HEAP_CLASS_NAME::PeekMaximum() const
{ {
if (fMaxLastElement > 0) if (fMaxLastElement > 0)
return fMaxElements[0]; return fMaxElements[0];