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
225
225
private List < List < CommandAst > > GetCommandElementGroups ( Ast configAst )
226
226
{
227
227
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 )
233
230
{
234
231
return result ;
235
232
}
236
233
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
251
237
foreach ( var group in parentChildrenGroup )
252
238
{
253
239
result . Add ( group . ToList ( ) ) ;
You can’t perform that action at this time.
0 commit comments