File tree Expand file tree Collapse file tree 1 file changed +5
-19
lines changed
Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -225,29 +225,15 @@ private IEnumerable<DiagnosticRecord> FindHashtableViolations(TokenOperations to
225225 private List < List < CommandAst > > GetCommandElementGroups ( Ast configAst )
226226 {
227227 var result = new List < List < CommandAst > > ( ) ;
228- var parents = new HashSet < Ast > ( ) ;
229- var parentChildrenGroup = configAst . FindAll ( ast => IsPropertyValueCommandAst ( ast ) , true ) ?
230- . Select ( ast => ast as CommandAst )
231- . GroupBy ( ast => ast . Parent . Parent ) ; // parent is pipeline and pipeline's parent is namedblockast
232- if ( parentChildrenGroup == null )
228+ var astsFound = configAst . FindAll ( ast => IsPropertyValueCommandAst ( ast ) , true ) ;
229+ if ( astsFound == null )
233230 {
234231 return result ;
235232 }
236233
237- // var parentChildrenMap = new Dictionary<Ast, List<Ast>>();
238- // foreach (var commandAst in commandAsts)
239- // {
240- // var parent = commandAst.Parent;
241- // if (parentChildrenMap.ContainsKey(parent))
242- // {
243- // parentChildrenMap[parent].Add(commandAst);
244- // }
245- // else
246- // {
247- // parentChildrenMap.Add(parent, new List<Ast>())
248- // }
249- // }
250-
234+ var parentChildrenGroup = from ast in astsFound
235+ select ( CommandAst ) ast into commandAst
236+ group commandAst by commandAst . Parent . Parent ; // parent is pipeline and pipeline's parent is namedblockast
251237 foreach ( var group in parentChildrenGroup )
252238 {
253239 result . Add ( group . ToList ( ) ) ;
You can’t perform that action at this time.
0 commit comments