Skip to content

Commit

Permalink
Corners::copy use copy constructor for parasitic_analysis_pts_
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Oct 16, 2023
1 parent 9e75a7a commit 29b94cc
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions search/Corner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ Corners::copy(Corners *corners)
clear();
int index = 0;
for (Corner *orig : corners->corners_) {
const char *name = orig->name();
Corner *corner = new Corner(name, index);
Corner *corner = new Corner(orig->name(), index);
corners_.push_back(corner);
// Use the copied name in the map.
corner_map_[corner->name()] = corner;
Expand All @@ -120,17 +119,10 @@ Corners::copy(Corners *corners)
parasitic_analysis_pts_.push_back(ap);
}

int i = 0;
for (Corner *orig : corners->corners_) {
for (size_t i = 0; i < corners->corners_.size(); i++) {
Corner *orig = corners->corners_[i];
Corner *corner = corners_[i];
auto &orig_aps = orig->parasitic_analysis_pts_;
auto &corner_aps = corner->parasitic_analysis_pts_;
corner_aps.resize(orig_aps.size());
for (ParasiticAnalysisPt *orig_ap : orig_aps) {
int ap_index = orig_ap->index();
corner_aps.push_back(parasitic_analysis_pts_[ap_index]);
}
i++;
corner->parasitic_analysis_pts_ = orig->parasitic_analysis_pts_;
}
}

Expand Down

0 comments on commit 29b94cc

Please sign in to comment.