changeset 30861:2f2e875d93fa stable

don't use mutable keyword for load_path data members * load-path.h, load-path.cc (load_path::m_package_map, load_path::m_top_level_package, load_path::m_dir_info_list, load_path::m_init_dirs): Don't declare data members as mutable. (load_path::update, load_path::add, load_path::get_package): Don't declare as const functions.
author John W. Eaton <jwe@octave.org>
date Thu, 24 Mar 2022 01:27:02 -0400
parents df26decca96b
children 070d5b04a0ac e2eed3610b7b
files libinterp/corefcn/load-path.cc libinterp/corefcn/load-path.h
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc	Wed Mar 23 18:27:53 2022 +0100
+++ b/libinterp/corefcn/load-path.cc	Thu Mar 24 01:27:02 2022 -0400
@@ -454,7 +454,7 @@
   }
 
   void
-  load_path::update (void) const
+  load_path::update (void)
   {
     // I don't see a better way to do this because we need to
     // preserve the correct directory ordering for new files that
@@ -1286,7 +1286,7 @@
 
   void
   load_path::add (const dir_info& di, bool at_end,
-                  const std::string& pname, bool updating) const
+                  const std::string& pname, bool updating)
   {
     package_info& l = get_package (pname);
 
--- a/libinterp/corefcn/load-path.h	Wed Mar 23 18:27:53 2022 +0100
+++ b/libinterp/corefcn/load-path.h	Thu Mar 24 01:27:02 2022 -0400
@@ -69,7 +69,7 @@
 
     bool remove (const std::string& dir);
 
-    void update (void) const;
+    void update (void);
 
     bool contains_canonical (const std::string& dir_name) const;
 
@@ -536,11 +536,11 @@
     void add (const std::string& dir, bool at_end, bool warn);
 
     void add (const dir_info& di, bool at_end, const std::string& pname = "",
-              bool updating = false) const;
+              bool updating = false);
 
     bool is_package (const std::string& name) const;
 
-    package_info& get_package (const std::string& name) const
+    package_info& get_package (const std::string& name)
     {
       if (! name.empty () && is_package (name))
         {
@@ -568,13 +568,13 @@
 
     interpreter& m_interpreter;
 
-    mutable package_map_type m_package_map;
+    package_map_type m_package_map;
 
-    mutable package_info m_top_level_package;
+    package_info m_top_level_package;
 
-    mutable dir_info_list_type m_dir_info_list;
+    dir_info_list_type m_dir_info_list;
 
-    mutable std::set<std::string> m_init_dirs;
+    std::set<std::string> m_init_dirs;
 
     std::string m_command_line_path;