]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Const-correctness fixes for fibonacci_heap.h
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 27 Sep 2019 18:24:44 +0000 (18:24 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 27 Sep 2019 18:24:44 +0000 (18:24 +0000)
gcc/ChangeLog:
* fibonacci_heap.h (fibonacci_heap::empty): Make const.
(fibonacci_heap::nodes): Likewise.
(fibonacci_heap::min_key): Likewise.
(fibonacci_heap::min): Likewise.

From-SVN: r276193

gcc/ChangeLog
gcc/fibonacci_heap.h

index 05ba915193e935d596719ae65857205e774be970..37037ab4cc60e75872d29ac9a25da7cd89c0fba1 100644 (file)
@@ -1,3 +1,10 @@
+2019-09-27  David Malcolm  <dmalcolm@redhat.com>
+
+       * fibonacci_heap.h (fibonacci_heap::empty): Make const.
+       (fibonacci_heap::nodes): Likewise.
+       (fibonacci_heap::min_key): Likewise.
+       (fibonacci_heap::min): Likewise.
+
 2019-09-27  David Malcolm  <dmalcolm@redhat.com>
 
        * cgraph.c (cgraph_node::get_fun): Make const.
index 6e0a2166c86fb3e0297cdd6fcbef957c19f2335e..3bd0a9f8af1e066e24fc194b7702e8017b85cee7 100644 (file)
@@ -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;