1- use cairo_lang_utils:: ordered_hash_map :: OrderedHashMap ;
1+ use cairo_lang_utils:: small_ordered_map :: SmallOrderedMap ;
22use thiserror:: Error ;
33
44use crate :: ids:: VarId ;
@@ -25,12 +25,12 @@ impl EditStateError {
2525
2626/// Given a map with var ids as keys, extracts out the given ids, failing if some id is missing.
2727pub fn take_args < ' a , V : ' a > (
28- mut state : OrderedHashMap < VarId , V > ,
28+ mut state : SmallOrderedMap < VarId , V > ,
2929 ids : impl Iterator < Item = & ' a VarId > ,
30- ) -> Result < ( OrderedHashMap < VarId , V > , Vec < V > ) , EditStateError > {
30+ ) -> Result < ( SmallOrderedMap < VarId , V > , Vec < V > ) , EditStateError > {
3131 let mut vals = vec ! [ ] ;
3232 for id in ids {
33- match state. swap_remove ( id) {
33+ match state. remove ( id) {
3434 None => {
3535 return Err ( EditStateError :: MissingReference ( id. clone ( ) ) ) ;
3636 }
@@ -44,9 +44,9 @@ pub fn take_args<'a, V: 'a>(
4444
4545/// Adds the given pairs to map with var ids as keys, failing if some variable is overridden.
4646pub fn put_results < ' a , V > (
47- mut state : OrderedHashMap < VarId , V > ,
47+ mut state : SmallOrderedMap < VarId , V > ,
4848 results : impl Iterator < Item = ( & ' a VarId , V ) > ,
49- ) -> Result < OrderedHashMap < VarId , V > , EditStateError > {
49+ ) -> Result < SmallOrderedMap < VarId , V > , EditStateError > {
5050 for ( id, v) in results {
5151 if state. insert ( id. clone ( ) , v) . is_some ( ) {
5252 return Err ( EditStateError :: VariableOverride ( id. clone ( ) ) ) ;
0 commit comments