3535//! [`Database`]: struct.Database.html
3636//! [`PathStitcher`]: struct.PathStitcher.html
3737
38- use std:: collections:: HashMap ;
3938use std:: collections:: VecDeque ;
4039#[ cfg( feature = "copious-debugging" ) ]
4140use std:: fmt:: Display ;
@@ -44,6 +43,7 @@ use std::ops::Index;
4443use crate :: arena:: Arena ;
4544use crate :: arena:: Handle ;
4645use crate :: arena:: HandleSet ;
46+ use crate :: arena:: HashArena ;
4747use crate :: arena:: List ;
4848use crate :: arena:: ListCell ;
4949use crate :: arena:: SupplementalArena ;
@@ -76,8 +76,7 @@ use crate::CancellationFlag;
7676pub struct Database {
7777 pub ( crate ) partial_paths : VecArena < PartialPath > ,
7878 pub ( crate ) local_nodes : HandleSet < Node > ,
79- symbol_stack_keys : VecArena < ListCell < Handle < Symbol > > > ,
80- symbol_stack_key_cache : HashMap < SymbolStackCacheKey , SymbolStackKeyHandle > ,
79+ symbol_stack_keys : HashArena < ListCell < Handle < Symbol > > > ,
8180 paths_by_start_node : SupplementalArena < Node , Vec < Handle < PartialPath > > > ,
8281 root_paths_by_precondition : SupplementalArena < SymbolStackKeyCell , Vec < Handle < PartialPath > > > ,
8382}
@@ -88,8 +87,7 @@ impl Database {
8887 Database {
8988 partial_paths : VecArena :: new ( ) ,
9089 local_nodes : HandleSet :: new ( ) ,
91- symbol_stack_keys : VecArena :: new ( ) ,
92- symbol_stack_key_cache : HashMap :: new ( ) ,
90+ symbol_stack_keys : HashArena :: new ( ) ,
9391 paths_by_start_node : SupplementalArena :: new ( ) ,
9492 root_paths_by_precondition : SupplementalArena :: new ( ) ,
9593 }
@@ -362,18 +360,7 @@ impl SymbolStackKey {
362360
363361 /// Pushes a new symbol onto the back of this symbol stack key.
364362 fn push_back ( & mut self , db : & mut Database , symbol : Handle < Symbol > ) {
365- let cache_key = SymbolStackCacheKey {
366- head : symbol,
367- tail : self . back_handle ( ) ,
368- } ;
369- if let Some ( handle) = db. symbol_stack_key_cache . get ( & cache_key) {
370- self . symbols = List :: from_handle ( * handle) ;
371- return ;
372- }
373- // push_front because we store the key's symbols in reverse order.
374363 self . symbols . push_front ( & mut db. symbol_stack_keys , symbol) ;
375- let handle = self . back_handle ( ) ;
376- db. symbol_stack_key_cache . insert ( cache_key, handle) ;
377364 }
378365
379366 /// Pops a symbol from the back of this symbol stack key.
0 commit comments