octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51871] loading '-ascii' format files is slow


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #51871] loading '-ascii' format files is slow
Date: Fri, 8 Sep 2017 17:29:37 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #29, bug #51871 (project octave):

Just looking at the changeset.  For reference, rdstate is described here:

http://www.cplusplus.com/reference/ios/ios/rdstate/

It looks like there is shorthand for


   if (status & std::ios::failbit)


could be replaced by


   if (is.fail ())


Also, in the table at the above link it looks like "bad" i/o operation also
sets the fail bit.  From reading this description

http://www.cplusplus.com/reference/ios/ios/bad/

it seems like float value out of range wouldn't be in the "bad" category.  So
I'm attaching a patch for you to consider that checks that is.bad() isn't
true.  Given that, it would probably be OK to change


+          is.clear (is.rdstate () & ~std::ios::failbit);


to a simple


+          is.clear ();


because EOF is not set, I suspect, (and we know 'bad' bit is not set because
we checked for that) but it's fine as is.

(file #41767)
    _______________________________________________________

Additional Item Attachment:

File name: octave-check_bad_bit-djs2017sep08.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51871>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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