Ignore:
Timestamp:
05/02/17 22:03:01 (3 years ago)
Author:
pkimmesw
Message:

#2665 Removed "this" qualifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/PushProgram.cs

    r14875 r14908  
    4343    public int Count { get { return expressions.Count; } }
    4444
    45     public IReadOnlyList<Expression> Expressions { get { return this.expressions; } }
     45    public IReadOnlyList<Expression> Expressions { get { return expressions; } }
    4646
    4747    public static PushProgram Create(IManagedPool<PushProgram> pool, IReadOnlyList<Expression> expressions) {
     
    152152        return true;
    153153
    154       if (this.GetType() != obj.GetType())
     154      if (GetType() != obj.GetType())
    155155        return false;
    156156
     
    168168
    169169    public override bool Eval(IInternalPushInterpreter interpreter) {
    170       interpreter.ExecStack.Push(this.expressions);
     170      interpreter.ExecStack.Push(expressions);
    171171      return true;
    172172    }
     
    184184      get
    185185      {
    186         return this.IsEmpty
     186        return IsEmpty
    187187            ? 1
    188188            // + 1 because "this" is also counted
     
    192192
    193193    public IEnumerable<Expression> DepthLast() {
    194       foreach (var expr in this.expressions) {
     194      foreach (var expr in expressions) {
    195195        if (expr.IsProgram)
    196196          foreach (var sub in ((PushProgram)expr).DepthLast())
     
    226226
    227227    public IList<Expression> CopyExpressions() {
    228       return new List<Expression>(this.expressions);
     228      return new List<Expression>(expressions);
    229229    }
    230230
     
    233233
    234234      var copy = expressionListPool.Get();
    235       copy.AddRange(this.expressions);
     235      copy.AddRange(expressions);
    236236
    237237      return copy;
     
    241241      var maxDepth = 1;
    242242      for (var i = 0; i < Count; i++) {
    243         var expression = this.expressions[i];
     243        var expression = expressions[i];
    244244        if (!expression.IsProgram) continue;
    245245        var expandExpression = (PushProgram)expression;
     
    265265
    266266      for (var i = Count - 1; i >= 0; i--) {
    267         var subExpression = this.expressions[i];
     267        var subExpression = expressions[i];
    268268
    269269        local_treeIndex[i] = next;
     
    283283
    284284      for (var i = 0; i < Count; i++) {
    285         hash = hash * 31 + this.expressions[i].GetHashCode();
     285        hash = hash * 31 + expressions[i].GetHashCode();
    286286      }
    287287
     
    349349
    350350      return TreeIndex[mid] == index
    351           ? resolver(parent, this, this.expressions[mid], mid, parentIndex)
    352           : (this.expressions[mid + 1] as PushProgram).GetFromTree(index - TreeIndex[mid + 1], mid + 1,
     351          ? resolver(parent, this, expressions[mid], mid, parentIndex)
     352          : (expressions[mid + 1] as PushProgram).GetFromTree(index - TreeIndex[mid + 1], mid + 1,
    353353              this, resolver);
    354354    }
Note: See TracChangeset for help on using the changeset viewer.