@@ -491,20 +491,6 @@ impl PySetInner {
491491 }
492492 }
493493
494- fn update (
495- & self ,
496- others : impl core:: iter:: Iterator < Item = ArgIterable > ,
497- vm : & VirtualMachine ,
498- ) -> PyResult < ( ) > {
499- for iterable in others {
500- for item in iterable. iter ( vm) ? {
501- let item = item?;
502- self . add ( & item, vm) ?;
503- }
504- }
505- Ok ( ( ) )
506- }
507-
508494 fn update_internal ( & self , iterable : PyObjectRef , vm : & VirtualMachine ) -> PyResult < ( ) > {
509495 // check AnySet
510496 if let Ok ( any_set) = AnySet :: try_from_object ( vm, iterable. to_owned ( ) ) {
@@ -592,15 +578,15 @@ impl PySetInner {
592578 Ok ( ( ) )
593579 }
594580
595- fn hash ( & self , vm : & VirtualMachine ) -> PyResult < PyHash > {
596- let hasher = self . content . try_fold_keys (
581+ fn hash ( & self ) -> PyHash {
582+ let hasher = self . content . fold_hashes (
597583 hash:: FrozenSetHash :: new ( self . len ( ) ) ,
598- |mut hasher, element | {
599- hasher. add ( element . hash ( vm ) ? ) ;
600- Ok ( hasher)
584+ |mut hasher, element_hash | {
585+ hasher. add ( element_hash ) ;
586+ hasher
601587 } ,
602- ) ? ;
603- Ok ( hasher. finish ( ) )
588+ ) ;
589+ hasher. finish ( )
604590 }
605591
606592 // Run operation, on failure, if item is a set/set subclass, convert it
@@ -887,7 +873,7 @@ impl PySet {
887873 }
888874
889875 fn __ior__ ( zelf : PyRef < Self > , set : AnySet , vm : & VirtualMachine ) -> PyResult < PyRef < Self > > {
890- zelf. inner . update ( set. into_iterable_iter ( vm ) ? , vm) ?;
876+ zelf. inner . merge_set ( set, vm) ?;
891877 Ok ( zelf)
892878 }
893879
@@ -1424,10 +1410,10 @@ impl AsSequence for PyFrozenSet {
14241410
14251411impl Hashable for PyFrozenSet {
14261412 #[ inline]
1427- fn hash ( zelf : & crate :: Py < Self > , vm : & VirtualMachine ) -> PyResult < PyHash > {
1413+ fn hash ( zelf : & crate :: Py < Self > , _vm : & VirtualMachine ) -> PyResult < PyHash > {
14281414 let hash = match zelf. hash . load ( Ordering :: Relaxed ) {
14291415 hash:: SENTINEL => {
1430- let hash = zelf. inner . hash ( vm ) ? ;
1416+ let hash = zelf. inner . hash ( ) ;
14311417 match Radium :: compare_exchange (
14321418 & zelf. hash ,
14331419 hash:: SENTINEL ,
0 commit comments