Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2685


Ignore:
Timestamp:
01/26/10 17:28:03 (15 years ago)
Author:
swagner
Message:

Fixed error in parameter lookup (#95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/ItemParameter.cs

    r2684 r2685  
    8888    public override IItem GetValue(ExecutionContext context, bool throwOnError) {
    8989      if (Value != null) return Value;
    90       ExecutionContext parent = context.Parent;
     90
     91      ExecutionContext current, child;
    9192      IParameter parameter = null;
    92 
    93       while ((parent != null) && (parameter == null)) {
    94         parent.Operator.Parameters.TryGetValue(ActualName, out parameter);
    95         parent = parent.Parent;
     93      child = context;
     94      current = context.Parent;
     95      while ((current != null) && (parameter == null)) {
     96        current.Operator.Parameters.TryGetValue(ActualName, out parameter);
     97        child = current;
     98        current = current.Parent;
    9699      }
    97100
    98       if (parameter != null) return parameter.GetValue(context);
     101      if (parameter != null) return parameter.GetValue(child, throwOnError);
    99102      else {
    100103        Variable variable = context.Scope.Lookup(ActualName, true, throwOnError);
Note: See TracChangeset for help on using the changeset viewer.