Free cookie consent management tool by TermsFeed Policy Generator

Opened 9 years ago

Closed 9 years ago

#2544 closed defect (done)

ScopeList clones list items twice

Reported by: abeham Owned by: abeham
Priority: high Milestone: HeuristicLab 3.3.14
Component: Core Version: 3.3.13
Keywords: Cc:

Description

The SubScopes collection of an IScope is of type ScopeList. In the ScopeList there is the following copy constructor:

    private ScopeList(ScopeList original, Cloner cloner)
      : base(original, cloner) {
      list = new List<IScope>(original.Select(x => cloner.Clone(x)));
    }

The copy constructor in the base class (ItemList<IScope>) looks as follows

    protected ItemList(ItemList<T> original, Cloner cloner) {
      cloner.RegisterClonedObject(original, this);
      list = new List<T>(original.Select(x => cloner.Clone(x)));
    }

Change History (4)

comment:1 Changed 9 years ago by abeham

  • Status changed from new to accepted

comment:2 Changed 9 years ago by abeham

  • Owner changed from abeham to ascheibe
  • Status changed from accepted to reviewing

r13450: fixed duplicate clone of list in ScopeList

Note that the items are not actually cloned twice as they're cached. Still, the list is allocated twice. The whole ScopeList class can probably be removed and replaced with ItemList<IScope>.

comment:3 Changed 9 years ago by ascheibe

  • Owner changed from ascheibe to abeham
  • Status changed from reviewing to readytorelease

Reviewed r13450, all good.

comment:4 Changed 9 years ago by abeham

  • Resolution set to done
  • Status changed from readytorelease to closed

r13452: merged to stable

Note: See TracTickets for help on using tickets.