public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Const-correctness fixes for fibonacci_heap.h
@ 2019-09-27 18:26 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2019-09-27 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

Obvious const-correctness fixes; I need these for a patch kit
I'm working on.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.

Committed to trunk (r276193) under the "obvious" rule.

gcc/ChangeLog:
	* fibonacci_heap.h (fibonacci_heap::empty): Make const.
	(fibonacci_heap::nodes): Likewise.
	(fibonacci_heap::min_key): Likewise.
	(fibonacci_heap::min): Likewise.
---
 gcc/fibonacci_heap.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/fibonacci_heap.h b/gcc/fibonacci_heap.h
index 6e0a216..3bd0a9f 100644
--- a/gcc/fibonacci_heap.h
+++ b/gcc/fibonacci_heap.h
@@ -162,19 +162,19 @@ public:
   fibonacci_node_t *insert (K key, V *data);
 
   /* Return true if no entry is present.  */
-  bool empty ()
+  bool empty () const
   {
     return m_nodes == 0;
   }
 
   /* Return the number of nodes.  */
-  size_t nodes ()
+  size_t nodes () const
   {
     return m_nodes;
   }
 
   /* Return minimal key presented in the heap.  */
-  K min_key ()
+  K min_key () const
   {
     if (m_min == NULL)
       gcc_unreachable ();
@@ -206,7 +206,7 @@ public:
   V *extract_min (bool release = true);
 
   /* Return value associated with minimum node in the heap.  */
-  V *min ()
+  V *min () const
   {
     if (m_min == NULL)
       return NULL;
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-27 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 18:26 [committed] Const-correctness fixes for fibonacci_heap.h David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).