It may sound stupid. I found plenty of codes that appear after a function returns.
For example in ProcessingUnit.cpp, line 700-712.
vector<vector<double> > CopySubArray(const vector<vector<double> > &orginal, int positionRow, int positionCol, int numRow, int numCol) {
vector<vector<double> > copy;
for (int i=0; i<numRow; i++) {
vector<double> copyRow;
for (int j=0; j<numCol; j++) {
copyRow.push_back(orginal[positionRow+i][positionCol+j]);
}
copy.push_back(copyRow);
copyRow.clear();
}
return copy;
copy.clear();
}
It seems that code after return (in the example copy.clear()) is useless.
Does such code do any job? Why add such code?
I'm so confused. Can anyone explain this to me? Thank you so much.
It may sound stupid. I found plenty of codes that appear after a function returns. For example in
ProcessingUnit.cpp
, line 700-712.It seems that code after return (in the example
copy.clear()
) is useless. Does such code do any job? Why add such code? I'm so confused. Can anyone explain this to me? Thank you so much.