You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: