File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -179,18 +179,18 @@ pub fn lcg_urandom(mut x: u32, buf: &mut [u8]) {
179179 }
180180}
181181
182+ #[ inline]
182183pub fn hash_object_id_raw ( p : usize ) -> PyHash {
183184 // TODO: Use commented logic when below issue resolved.
184185 // Ref: https://github.com/RustPython/RustPython/pull/3951#issuecomment-1193108966
185186
186- // let mut y = p;
187- // /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
188- // excessive hash collisions for dicts and sets */
189- // y = (y >> 4) | (y << (8 * std::mem::size_of::<usize>() - 4));
190- // y as PyHash
187+ /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
188+ excessive hash collisions for dicts and sets */
189+ // p.rotate_right(4) as PyHash
191190 p as PyHash
192191}
193192
193+ #[ inline]
194194pub fn hash_object_id ( p : usize ) -> PyHash {
195195 fix_sentinel ( hash_object_id_raw ( p) )
196196}
You can’t perform that action at this time.
0 commit comments