Mercurial > octave
comparison libinterp/octave-value/cdef-utils.cc @ 31105:670a0d878af1
eliminate WHO arguments from interpreter-private functions
* interpreter-private.h, inpterpreter-private.cc (__get_interpreter__,
__get_dynamic_loader__, __get_error_system__, __get_gh_manager__,
__get_help_system__, __get_input_system__, __get_load_path__,
__get_load_save_system__, __get_event_manager__,
__get_output_system__, __get_type_info__, __get_symbol_table__,
__get_current_scope__, __require_current_scope__, __get_evaluator__,
__get_bp_table__, __get_child_list__, __get_cdef_manager__,
__get_display_info__, __get_gtk_manager__): Eliminate WHO argument.
Previously, it was never displayed by __get_interpreter__. And, as
pointed out by Petter Tomner in patch #10216, passing a std::string
object could have performance issues.
(__get_interpreter__): Eliminate useless call to error. Display
message to std::cerr then abort.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Jun 2022 12:48:59 -0400 |
parents | 83f9f8bda883 |
children | e88a07dec498 |
comparison
equal
deleted
inserted
replaced
31104:90549b20fb28 | 31105:670a0d878af1 |
---|---|
78 | 78 |
79 cdef_class | 79 cdef_class |
80 lookup_class (const std::string& name, bool error_if_not_found, | 80 lookup_class (const std::string& name, bool error_if_not_found, |
81 bool load_if_not_found) | 81 bool load_if_not_found) |
82 { | 82 { |
83 cdef_manager& cdm = __get_cdef_manager__ ("lookup_class"); | 83 cdef_manager& cdm = __get_cdef_manager__ (); |
84 | 84 |
85 return cdm.find_class (name, error_if_not_found, load_if_not_found); | 85 return cdm.find_class (name, error_if_not_found, load_if_not_found); |
86 } | 86 } |
87 | 87 |
88 cdef_class | 88 cdef_class |
236 | 236 |
237 cdef_package | 237 cdef_package |
238 lookup_package (const std::string& name, bool error_if_not_found, | 238 lookup_package (const std::string& name, bool error_if_not_found, |
239 bool load_if_not_found) | 239 bool load_if_not_found) |
240 { | 240 { |
241 cdef_manager& cdm = __get_cdef_manager__ ("lookup_package"); | 241 cdef_manager& cdm = __get_cdef_manager__ (); |
242 | 242 |
243 return cdm.find_package (name, error_if_not_found, load_if_not_found); | 243 return cdm.find_package (name, error_if_not_found, load_if_not_found); |
244 } | 244 } |
245 | 245 |
246 cdef_class | 246 cdef_class |
255 // overrides whatever dispatch class there is for the currently | 255 // overrides whatever dispatch class there is for the currently |
256 // executing function so that function handles returned from class | 256 // executing function so that function handles returned from class |
257 // methods will use the dispatch class of the class in which they | 257 // methods will use the dispatch class of the class in which they |
258 // are defined instead of the class in which they are executing. | 258 // are defined instead of the class in which they are executing. |
259 | 259 |
260 tree_evaluator& tw = __get_evaluator__ ("get_class_context"); | 260 tree_evaluator& tw = __get_evaluator__ (); |
261 | 261 |
262 std::string dispatch_class = tw.get_dispatch_class (); | 262 std::string dispatch_class = tw.get_dispatch_class (); |
263 | 263 |
264 if (! dispatch_class.empty ()) | 264 if (! dispatch_class.empty ()) |
265 return lookup_class (dispatch_class); | 265 return lookup_class (dispatch_class); |