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

 
 

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

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

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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.savanna ... /rev/7026da637999.

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

Best wishes,
Rik

Rik <rik5>
Group 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>

 

Attached Files

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

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    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.16-ed84.
    Corresponding source code