octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57211] __appdata__ property should be hidden


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #57211] __appdata__ property should be hidden
Date: Wed, 13 Nov 2019 03:48:07 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Follow-up Comment #8, bug #57211 (project octave):

Wow, that update came fast.

Was it possible to remove all try-catches in getappdata?


diff -r fad2b816df2d -r 854033674ab7 scripts/gui/getappdata.m
--- a/scripts/gui/getappdata.m  Tue Nov 12 22:37:19 2019 +0100
+++ b/scripts/gui/getappdata.m  Wed Nov 13 09:25:39 2019 +0100
@@ -50,7 +50,7 @@
     value = cell (numel (h), 1);
     for i = 1:numel (h)
-      try
-        value{i} = (get (h(i), "__appdata__")).(name);
-      end_try_catch
+      value{i} = (get (h(i), "applicationdata")).(name);
     endfor
 
@@ -62,11 +62,7 @@
     if (numel (h) != 1)
       error ("getappdata: Only one handle H may be used when fetching
appdata");
     endif
-    try
-      value = get (h, "__appdata__");
-    catch
-      value = struct ();
-    end_try_catch
+    value = get (h, "applicationdata");
   endif
 
 endfunction


as with your patch not all graphic handles have this property and all "h" are
checked to be such:


if (! all (ishghandle (h(:))))


Just had a look that Rik introduced that try-catch semantic and this indeed
increased the performance, even though it looks like a reasonable use-case of
that anti-pattern to me ;-)
https://hg.savannah.gnu.org/hgweb/octave/rev/a94a1d742938

Regarding comment #6 and comment #7.  Then it looks like it should better not
be renamed...

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57211>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]