changeset 22836:296d9b0eec8d

Code cleanup for cset 96228c17a66a. * graphics.cc: Use C++11 for : map structure to simplify foor loop. Use single quotes in BIST test strings to avoid having to escape double quotes. Add semicolons to end of statements in BIST tests.
author Rik <rik@octave.org>
date Mon, 28 Nov 2016 09:03:28 -0800
parents b824691fa401
children b125351d4243
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Mon Nov 28 09:48:46 2016 -0500
+++ b/libinterp/corefcn/graphics.cc	Mon Nov 28 09:03:28 2016 -0800
@@ -1589,10 +1589,8 @@
       type_ok = false;
       graphics_object obj = gh_manager::get_object (gh);
 
-      for (std::set<std::string>::const_iterator
-           p = type_constraints.begin ();
-           p != type_constraints.end (); p++)
-        if (obj.isa (*p))
+      for (const auto& type : type_constraints)
+        if (obj.isa (type))
           {
             type_ok = true;
             break;
@@ -1630,9 +1628,9 @@
 %!   catch
 %!     err = lasterr ();
 %!   end_try_catch
-%!   assert (err, "set: invalid graphics object type for property \"uicontextmenu\"");
+%!   assert (err, 'set: invalid graphics object type for property "uicontextmenu"');
 %! unwind_protect_cleanup
-%!   delete (hf)
+%!   delete (hf);
 %! end_unwind_protect   
 */
 
@@ -4625,21 +4623,21 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   hax =  axes ("parent", hf);
+%!   hax = axes ("parent", hf);
 %!   try 
 %!     set (hax, "linewidth", -1);
 %!   catch
 %!     err = lasterr ();
 %!   end_try_catch
-%!   assert (err, "set: \"linewidth\" must be greater than 0")
+%!   assert (err, 'set: "linewidth" must be greater than 0');
 %!   try 
 %!     set (hax, "minorgridalpha", 1.5);
 %!   catch
 %!     err = lasterr ();
 %!   end_try_catch
-%!   assert (err, "set: \"minorgridalpha\" must be less than or equal to 1")
+%!   assert (err, 'set: "minorgridalpha" must be less than or equal to 1');
 %! unwind_protect_cleanup
-%!   delete (hf)
+%!   delete (hf);
 %! end_unwind_protect   
 */