Mercurial > octave
changeset 22873:2830a770405b
maint: Fix up more for loops with range operators in liboctave.
* cmd-edit.cc, oct-shlib.cc, singleton-cleanup.cc:
Use better declarations of range operators in for loops for clarity.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 08 Dec 2016 15:22:58 -0800 |
parents | 551ac93c984c |
children | 763ec7cbee9e |
files | liboctave/util/cmd-edit.cc liboctave/util/oct-shlib.cc liboctave/util/singleton-cleanup.cc |
diffstat | 3 files changed, 6 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/cmd-edit.cc Thu Dec 08 14:50:52 2016 -0800 +++ b/liboctave/util/cmd-edit.cc Thu Dec 08 15:22:58 2016 -0800 @@ -1108,10 +1108,8 @@ int command_editor::startup_handler (void) { - for (auto& fcnptr : startup_hook_set) + for (startup_hook_fcn f : startup_hook_set) { - startup_hook_fcn f = *fcnptr; - if (f) f (); } @@ -1122,10 +1120,8 @@ int command_editor::pre_input_handler (void) { - for (auto& fcnptr : pre_input_hook_set) + for (pre_input_hook_fcn f : pre_input_hook_set) { - pre_input_hook_fcn f = *fcnptr; - if (f) f (); } @@ -1142,10 +1138,8 @@ event_hook_lock.unlock (); - for (auto& fcnptr : hook_set) + for (event_hook_fcn f : hook_set) { - event_hook_fcn f = *fcnptr; - if (f) f (); }
--- a/liboctave/util/oct-shlib.cc Thu Dec 08 14:50:52 2016 -0800 +++ b/liboctave/util/oct-shlib.cc Thu Dec 08 15:22:58 2016 -0800 @@ -144,8 +144,8 @@ void dynamic_library::dynlib_rep::do_close_hook (dynamic_library::close_hook cl_hook) { - for (auto& fcn_sz_p : fcn_names) - cl_hook (fcn_sz_p.first); + for (auto& fcn_sz : fcn_names) + cl_hook (fcn_sz.first); fcn_names.clear (); }
--- a/liboctave/util/singleton-cleanup.cc Thu Dec 08 14:50:52 2016 -0800 +++ b/liboctave/util/singleton-cleanup.cc Thu Dec 08 15:22:58 2016 -0800 @@ -31,10 +31,8 @@ singleton_cleanup_list::~singleton_cleanup_list (void) { - for (auto fcnptr : fcn_list) + for (fptr fcn : fcn_list) { - fptr fcn = *fcnptr; - fcn (); } }