Changeset 12509 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars
- Timestamp:
- 06/25/15 13:46:24 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs
r12422 r12509 338 338 List<string> temp; 339 339 if (allowedChildSymbols.TryGetValue(parent.Name, out temp)) { 340 if (temp.SelectMany(s => GetSymbol(s).Flatten()).Any(s => s.Name == child.Name)) { 341 cachedIsAllowedChildSymbol.Add(key, true); 342 return true; 340 for (int i = 0; i < temp.Count; i++) { 341 var symbol = GetSymbol(temp[i]); 342 foreach (var s in symbol.Flatten()) 343 if (s.Name == child.Name) { 344 cachedIsAllowedChildSymbol.Add(key, true); 345 return true; 346 } 343 347 } 344 348 } … … 365 369 List<string> temp; 366 370 if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, argumentIndex), out temp)) { 367 if (temp.SelectMany(s => GetSymbol(s).Flatten()).Any(s => s.Name == child.Name)) { 368 cachedIsAllowedChildSymbolIndex.Add(key, true); 369 return true; 371 for (int i = 0; i < temp.Count; i++) { 372 var symbol = GetSymbol(temp[i]); 373 foreach (var s in symbol.Flatten()) 374 if (s.Name == child.Name) { 375 cachedIsAllowedChildSymbolIndex.Add(key, true); 376 return true; 377 } 370 378 } 371 379 }
Note: See TracChangeset
for help on using the changeset viewer.