changeset 31175:2b8e8637a64e

maint: merge stable to default
author Rik <rik@octave.org>
date Wed, 03 Aug 2022 15:44:17 -0700
parents 06dc7fe25322 (current diff) fb1c7c8a030b (diff)
children bf6376a754a4
files libinterp/octave-value/ov-classdef.cc
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-classdef.cc	Wed Aug 03 19:00:39 2022 +0200
+++ b/libinterp/octave-value/ov-classdef.cc	Wed Aug 03 15:44:17 2022 -0700
@@ -746,6 +746,7 @@
 
   if (cls.ok ())
     {
+      // Find methods for classdef objects.
       std::map<std::string, cdef_method> method_map
         = cls.get_method_map (false, true);
 
@@ -760,11 +761,13 @@
 
       sv = string_vector (method_names);
     }
+  else
+    {
+      // Find methods for legacy @CLASS objects.
+      load_path& lp = interp.get_load_path ();
 
-  // The following will also find methods for legacy @CLASS objects.
-  load_path& lp = interp.get_load_path ();
-
-  sv.append (lp.methods (class_name));
+      sv = string_vector (lp.methods (class_name));
+    }
 
   return ovl (Cell (sv));
 }