dictionary closing scope does flush
Writing a subdictionary using dictionary::write causes a flush of the underlying stream. Ideally we would only flush at IOdictionary closing.
Writing a subdictionary using dictionary::write causes a flush of the underlying stream. Ideally we would only flush at IOdictionary closing.
No child items are currently assigned. Use child items to break down this issue into smaller parts.
I've put some print stmts in flush:
The dictionary flush is a holdover from the old code that had an endl
. The nl
part moved into the endBlock() method and the flush got added so as not to change anything.
Will remove the flush in dictionary, but most of the flushes are actually coming from gratuitous use of endl
when a nl
would probably suffice.
Any reason to flush at closing at all?
Only if it is things we might read from another program e.g. fields. c type fclose guarantees a flush but not sure about c++ ofstream.
Seems to be covered as expected: http://www.cplusplus.com/reference/fstream/ofstream/close/
mentioned in commit fdee9442