]> git.lizzy.rs Git - rust.git/commit
Remove `sip::Hasher::short_write`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 25 Feb 2020 05:41:40 +0000 (16:41 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Tue, 25 Feb 2020 23:59:35 +0000 (10:59 +1100)
commit54d1c50c7e7b4c4c7dca6c85c6965c886922b449
tree547c9738b4ccd10f9d3d44f40584b16d79779d4a
parentb1f395de642e8be7bcbbd2bd8aaadab715851f49
Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See #69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.
src/libcore/hash/sip.rs