Skip to content

Commit ed9a993

Browse files
BUG: fixed copy
1 parent 7de3a43 commit ed9a993

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/c/classes/Inputs/TransientInput.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,11 @@ Input* TransientInput::copy() {/*{{{*/
6363
_assert_(this->timesteps.size()==this->numtimesteps);
6464
_assert_(this->inputs.size()==this->numtimesteps);
6565

66-
TransientInput* output=NULL;
67-
68-
output = new TransientInput();
66+
TransientInput* output = new TransientInput();
6967
output->enum_type = this->enum_type;
70-
output->numtimesteps = this->enum_type;
71-
72-
output->timesteps = this->timesteps; /* performs a Deep copy*/
73-
68+
output->numtimesteps = this->numtimesteps;
7469
for(int i=0;i<this->numtimesteps;i++){
70+
output->timesteps.push_back(this->timesteps[i]);
7571
if(this->inputs[i]){
7672
output->inputs.push_back(this->inputs[i]->copy());
7773
}
@@ -81,6 +77,9 @@ Input* TransientInput::copy() {/*{{{*/
8177
}
8278
output->parameters=this->parameters;
8379

80+
_assert_(output->timesteps.size()==output->numtimesteps);
81+
_assert_(output->inputs.size()==output->numtimesteps);
82+
8483
return output;
8584
}/*}}}*/
8685
void TransientInput::DeepEcho(void){/*{{{*/

0 commit comments

Comments
 (0)