1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0033375: Coding - Static Analyzing processing. Performance

Performance update applied:
  - moving to const reference as much as possible
Result of CLANG_TIDY (static analyzing filter: perform*)
This commit is contained in:
dpasukhi
2023-05-06 22:56:45 +00:00
committed by vglukhik
parent c28dd7f1cf
commit b2fedee6a1
265 changed files with 603 additions and 611 deletions

View File

@@ -39,7 +39,7 @@
#define NbControl 23
static void ContourProperties(TopoDS_Wire wire,
static void ContourProperties(const TopoDS_Wire& wire,
Standard_Real& countourArea,
Standard_Real& countourLength)
{
@@ -49,8 +49,9 @@ static void ContourProperties(TopoDS_Wire wire,
gp_XYZ prev, cont;
for (BRepTools_WireExplorer exp(wire); exp.More(); exp.Next()) {
TopoDS_Edge Edge = exp.Current(); nbe++;
const TopoDS_Edge& Edge = exp.Current();
nbe++;
Standard_Real First, Last;
Handle(Geom_Curve) c3d;
ShapeAnalysis_Edge sae;

View File

@@ -56,7 +56,7 @@ void ShapeAnalysis_Shell::Clear()
if (shape.ShapeType() == TopAbs_SHELL) myShells.Add (shape); //szv#4:S4163:12Mar99 i =
else {
for (TopExp_Explorer exs (shape,TopAbs_SHELL); exs.More(); exs.Next()) {
TopoDS_Shape sh = exs.Current();
const TopoDS_Shape& sh = exs.Current();
myShells.Add (sh); //szv#4:S4163:12Mar99 i =
}
}
@@ -120,7 +120,7 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh
TopTools_IndexedMapOfShape dirs, revs, ints;
for (TopExp_Explorer exs(shape,TopAbs_SHELL); exs.More(); exs.Next()) {
TopoDS_Shape sh = exs.Current();
const TopoDS_Shape& sh = exs.Current();
//szv#4:S4163:12Mar99 optimized
if (CheckEdges (sh,myBad,dirs,revs,ints))
if (myShells.Add (sh)) res = Standard_True;
@@ -134,7 +134,7 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh
Standard_Integer nb = dirs.Extent();
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 1; i <= nb; i ++) {
TopoDS_Shape sh = dirs.FindKey (i);
const TopoDS_Shape& sh = dirs.FindKey (i);
if (!myBad.Contains(sh)) {
if (!revs.Contains(sh)) {
if(checkinternaledges) {
@@ -154,7 +154,7 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh
nb = revs.Extent();
for (i = 1; i <= nb; i ++) {
TopoDS_Shape sh = revs.FindKey (i);
const TopoDS_Shape& sh = revs.FindKey (i);
if (!myBad.Contains(sh)) {
if (!dirs.Contains(sh)) {
if(checkinternaledges) {

View File

@@ -231,7 +231,7 @@ Standard_Real ShapeAnalysis_TransferParametersProj::Perform(const Standard_Real
//function : CorrectParameter
//purpose : auxiliary
//=======================================================================
static Standard_Real CorrectParameter(const Handle(Geom2d_Curve) crv,
static Standard_Real CorrectParameter(const Handle(Geom2d_Curve)& crv,
const Standard_Real param)
{
if(crv->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) {
@@ -580,7 +580,7 @@ TopoDS_Vertex ShapeAnalysis_TransferParametersProj::CopyNMVertex (const TopoDS_V
//update tolerance
Standard_Boolean needUpdate = Standard_False;
gp_Pnt aPV = (*((Handle(BRep_TVertex)*)&anewV.TShape()))->Pnt();
TopLoc_Location toLoc = toedge.Location();
const TopLoc_Location& toLoc = toedge.Location();
BRep_ListIteratorOfListOfCurveRepresentation toitcr
((*((Handle(BRep_TEdge)*)&toedge.TShape()))->ChangeCurves());