-
Notifications
You must be signed in to change notification settings - Fork 2
Add oZFile_fwrite
method
#4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
force pushes are some minor commit amends |
stubs etc. are now added |
Looks good. Glad you figured out the Speaking of which, there's one more step to the process: you need to register Only one little nitpick, hope you don't mind: use consistent order for the new stuff e.g. FWIW, don't FWIW, there are other things that I do slightly differently these days e.g. I'm no longer putting all C function declarations in a big monolitic file like Thanks! |
Whoops, I totally forgot about that 😅 thanks for the catch! I remembered to do that in the other PRs I have open, but I guess it slipped through the cracks here.
Totally makes sense, I appreciate the feedback. I've just made that change to the code.
Makes sense haha...I'm a big fan of the Fortran-style syntax with declarations before code, especially in smaller functions, but I'll keep that in mind for the future.
Makes sense, I do something similar in SynExtend. That would probably be a nice change for code organization and future maintainability, but like you mentioned it's not super high priority and would entail a good bit of work. Thanks for the feedback! Just pushed changes in response to your comments. |
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
.