Skip to content

Commit

Permalink
pdn: use swap in Shape::convertVectorToTree
Browse files Browse the repository at this point in the history
Assignment doesn't guarantee a capacity reduction.

Signed-off-by: Matt Liberty <[email protected]>
  • Loading branch information
maliberty committed Mar 14, 2024
1 parent 4fdf971 commit 5674cb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pdn/src/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ ShapeTreeMap Shape::convertVectorToTree(ShapeVectorMap& vec)
trees[layer] = ShapeTree(vals.begin(), vals.end());
}

vec = ShapeVectorMap();
ShapeVectorMap empty;
vec.swap(empty);

return trees;
}
Expand Down

0 comments on commit 5674cb7

Please sign in to comment.