-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
move crc32c to stdlib #24489
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
move crc32c to stdlib #24489
Conversation
base/deprecated.jl
Outdated
| @deprecate_moved watch_file "FileWatching" true true | ||
| @deprecate_moved FileMonitor "FileWatching" true true | ||
|
|
||
| @deprecate_moved crc32c "CRC32C" true true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later on you don't capitalize the last letter in "CRC32c"?
| crc32c_sw(s::String, crc::UInt32=0x00000000) = unsafe_crc32c_sw(s, sizeof(s), crc) | ||
| function crc32c_sw(io::IO, nb::Integer, crc::UInt32=0x00000000) | ||
| nb < 0 && throw(ArgumentError("number of bytes to checksum must be ≥ 0")) | ||
| buf = Array{UInt8}(min(nb, 24576)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but maybe you can change this to a Vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a vector already. Not sure why you object to the Array{T}(n) constructor, which is documented and type-stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it should help the reduce runtime cost if we explicitly specify it as a one-dimensional array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it does not reduce any runtime cost. It's only recommended for clarity and minor type inference performance.
StefanKarpinski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fix #24235
CC @stevengj, @StefanKarpinski