File tree Expand file tree Collapse file tree 1 file changed +14
-17
lines changed
graph/src/components/store Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -212,8 +212,20 @@ impl EntityCache {
212
212
// a legacy subgraph that has VID autoincremented while this trait
213
213
// always creates it in a new style.
214
214
debug_assert ! ( match scope {
215
- GetScope :: Store =>
216
- remove_vid( entity. clone( ) ) == remove_vid( self . store. get( key) . unwrap( ) . map( Arc :: new) ) ,
215
+ GetScope :: Store => {
216
+ // Release build will never call this function and hence it's OK
217
+ // when that implementation is not correct.
218
+ fn remove_vid( entity: Option <Arc <Entity >>) -> Option <Entity > {
219
+ entity. map( |e| {
220
+ #[ allow( unused_mut) ]
221
+ let mut entity = ( * e) . clone( ) ;
222
+ #[ cfg( debug_assertions) ]
223
+ entity. remove( "vid" ) ;
224
+ entity
225
+ } )
226
+ }
227
+ remove_vid( entity. clone( ) ) == remove_vid( self . store. get( key) . unwrap( ) . map( Arc :: new) )
228
+ }
217
229
GetScope :: InBlock => true ,
218
230
} ) ;
219
231
@@ -558,18 +570,3 @@ impl EntityCache {
558
570
} )
559
571
}
560
572
}
561
-
562
- // Release build still needs this function althought it will never call it
563
- #[ cfg( not( debug_assertions) ) ]
564
- fn remove_vid ( _: Option < Arc < Entity > > ) -> Option < Entity > {
565
- None
566
- }
567
-
568
- #[ cfg( debug_assertions) ]
569
- fn remove_vid ( entity : Option < Arc < Entity > > ) -> Option < Entity > {
570
- entity. map ( |e| {
571
- let mut entity = ( * e) . clone ( ) ;
572
- entity. remove ( "vid" ) ;
573
- entity
574
- } )
575
- }
You can’t perform that action at this time.
0 commit comments