File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,12 @@ export class IndexedStatementsStore implements PolicyStatementStore {
4444 }
4545
4646 addAll ( statements : ParsedPolicyStatement [ ] ) {
47- statements . forEach ( ( statement ) =>
48- this . #statements. set ( statement [ SYM_SID ] , statement )
49- ) ;
50- this . #reindexAll( statements ) ;
47+ const sids = statements . map ( ( statement ) => {
48+ const sid = statement [ SYM_SID ] ;
49+ this . #statements. set ( sid , statement ) ;
50+ return sid ;
51+ } ) ;
52+ this . #reindexAll( sids ) ;
5153 }
5254
5355 get ( sid : string ) : ParsedPolicyStatement | undefined {
@@ -85,8 +87,18 @@ export class IndexedStatementsStore implements PolicyStatementStore {
8587 return statement ;
8688 }
8789
88- #reindexAll( statements : ParsedPolicyStatement [ ] ) {
89- const sids = statements . map ( ( s ) => s [ SYM_SID ] ) ;
90+ #reindexAll( sids : string [ ] ) {
91+ const statements : ParsedPolicyStatement [ ] = [ ] ;
92+
93+ sids . forEach ( ( sid ) => {
94+ const statement = this . #statements. get ( sid ) ;
95+
96+ if ( ! statement ) {
97+ return ;
98+ } else {
99+ statements . push ( statement ) ;
100+ }
101+ } ) ;
90102
91103 const globAll = statements
92104 . filter ( ( s ) => s . actionsByType . globAll )
You can’t perform that action at this time.
0 commit comments