patchGNU Octave - Patches: patch #8839, maint: utils.cc: invert...

 
 

patch #8839: maint: utils.cc: invert if/else/error instances.

Submitted by:  Doug Stewart <dastew>
Submitted on:  Wed 23 Dec 2015 02:58:42 AM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 23 Dec 2015 05:30:16 PM UTC, comment #1: 

@Doug: Looks good.  I made two small changes.  The first was to "distribute" the ! operator.  Instead of
.

if (! nr == 1 && ! nc == 1)

I wrote

if (nr != 1 && nc != 1)

The second change was to add a newline after the call to error().  This helps with the visuals.  When all the code is squished together it is natural to think that the flow of execution proceeds one statement after another.  But, by opening a break one has the idea that one block of code may be executed and that the second may or may not be.  Instead of

if (! nr == 1 && ! nc == 1)
  error ("%s (A): use %s (size (A)) instead", warn_for, warn_for);
Array<double> v = a.vector_value ();

I wrote

if (! nr == 1 && ! nc == 1)
  error ("%s (A): use %s (size (A)) instead", warn_for, warn_for);

Array<double> v = a.vector_value ();

I checked in your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/7026da637999.

I think you have the hang of it now and can start pumping out the patches.

Best wishes,
Rik

Rik <rik5>
Project Administrator
Wed 23 Dec 2015 02:58:42 AM UTC, original submission:  

>> test utils

PASSES 90 out of 90 tests

>>


I think this is a better result.

Doug Stewart <dastew>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #35846:  utils.cc..patch added by dastew (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dastew (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-23 rik5 StatusNone => Done
        Open/ClosedOpen => Closed
    2015-12-23 dastew Attached File- => Added utils.cc..patch, #35846

    Back to the top


    Powered by Savane 3.5