Skip to content

Conversation

@KristofferC
Copy link
Member

@KristofferC KristofferC commented Nov 6, 2017

@deprecate_moved watch_file "FileWatching" true true
@deprecate_moved FileMonitor "FileWatching" true true

@deprecate_moved crc32c "CRC32C" true true
Copy link
Member

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))
Copy link
Contributor

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

Copy link
Member

@stevengj stevengj Nov 6, 2017

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.

Copy link
Contributor

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

Copy link
Contributor

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.

@ararslan ararslan added the stdlib Julia's standard library label Nov 6, 2017
Copy link
Member

@StefanKarpinski StefanKarpinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stevengj stevengj merged commit 8e96fbc into master Nov 7, 2017
@stevengj stevengj deleted the kc/crc32stdlib branch November 7, 2017 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Julia's standard library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants