changeset 15442:e5a07d7aafcc

legend.m: Remove unused warning variable and associated code. * legend.m: Remove unused warning variable and associated code.
author Rik <rik@octave.org>
date Tue, 25 Sep 2012 08:11:22 -0700
parents 1db706430c96
children 015cc3d1f389
files scripts/plot/legend.m
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m
+++ b/scripts/plot/legend.m
@@ -357,7 +357,6 @@
     endif
 
     if (strcmp (textpos, "default"))
-      warned = false;
       k = nkids;
       for i = 1 : nargs
         arg = varargin{i};
@@ -389,14 +388,14 @@
             if (--k == 0)
               break;
             endif
-          elseif (! warned)
-            break;
+          else
+            break;  # k = 0, no further handles to process
           endif
         else
           error ("legend: expecting argument to be a character string");
         endif
       endfor
-      if (i < nargs && ! warned)
+      if (i < nargs)
         warning ("legend: ignoring extra labels");
       endif
     else
@@ -440,7 +439,7 @@
     if (isempty (hplots))
       if (! isempty (hlegend))
         fkids = get (fig, "children");
-        delete (fkids (fkids == hlegend));
+        delete (fkids(fkids == hlegend));
         hlegend = [];
         hobjects = [];
         hplots  = [];
@@ -760,10 +759,10 @@
                    "xliminclude", "off", "yliminclude", "off");
         set (t1, "deletefcn", {@deletelegend1, hlegend});
 
-        ## Resize the axis the legend is attached to if the
-        ## legend is "outside" the plot and create listener to
+        ## Resize the axis that the legend is attached to if the
+        ## legend is "outside" the plot and create a listener to
         ## resize axis to original size if the legend is deleted,
-        ## hidden or shown
+        ## hidden, or shown.
         if (outside)
           for i = 1 : numel (ca)
             units = get (ca(i), "units");