[Top][All Lists]

[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);
@@ -62,11 +62,7 @@
     if (numel (h) != 1)
       error ("getappdata: Only one handle H may be used when fetching
-    try
-      value = get (h, "__appdata__");
-    catch
-      value = struct ();
-    end_try_catch
+    value = get (h, "applicationdata");

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 ;-)

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


Reply to this item at:


  Message sent via Savannah

reply via email to

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