Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds analogous
fwrite
method foroZFile
accessors.fwrite
tends to be slightly faster thanputs
since it doesn't have to check every character for'\0'
, which allows for some OS optimization. Would be useful to use inBiostrings
forwriteXStringSet
since the write size of blocks are known in advance, so appending'\0'
and then asking the OS to check for it is overkill.Function arguments follow conventions of the other
oZFile*
functions despite differing fromfwrite
argument syntax.gzfwrite
is defined here:https://github.com/madler/zlib/blob/ef24c4c7502169f016dcd2a26923dbaf3216748c/gzwrite.c#L260-L262
Header definition is here:
https://github.com/madler/zlib/blob/ef24c4c7502169f016dcd2a26923dbaf3216748c/zlib.h#L1472-L1473
I moved the
n==nitems
check to the end of the switch case because I find it significantly more readable than the alternative inoZFile_puts
.