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

@@ -288,8 +288,8 @@ void ShapeBuild_Edge::SetRange3d (const TopoDS_Edge& edge,
void ShapeBuild_Edge::CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const
{
TopLoc_Location fromLoc = fromedge.Location();
TopLoc_Location toLoc = toedge.Location();
const TopLoc_Location& fromLoc = fromedge.Location();
const TopLoc_Location& toLoc = toedge.Location();
for (BRep_ListIteratorOfListOfCurveRepresentation fromitcr
((*((Handle(BRep_TEdge)*)&fromedge.TShape()))->ChangeCurves()); fromitcr.More(); fromitcr.Next()) {
Handle(BRep_GCurve) fromGC = Handle(BRep_GCurve)::DownCast(fromitcr.Value());

View File

@@ -59,7 +59,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
TopoDS_Compound C;
B.MakeCompound (C);
for (TopoDS_Iterator it (shape); it.More(); it.Next()) {
TopoDS_Shape sh = it.Value();
const TopoDS_Shape& sh = it.Value();
Standard_Integer stat = Status (sh,newsh,Standard_False);
if (stat != 0) modif = 1;
if (stat >= 0) B.Add (C,newsh);
@@ -75,7 +75,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
TopoDS_Solid S;
B.MakeSolid (S);
for (TopoDS_Iterator it (shape); it.More(); it.Next()) {
TopoDS_Shape sh = it.Value();
const TopoDS_Shape& sh = it.Value();
newsh = Apply (sh,until,buildmode);
if (newsh.IsNull()) {
modif = -1;
@@ -83,7 +83,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
else if (newsh.ShapeType() != TopAbs_SHELL) {
Standard_Integer nbsub = 0;
for (TopExp_Explorer exh(newsh,TopAbs_SHELL); exh.More(); exh.Next()) {
TopoDS_Shape onesh = exh.Current ();
const TopoDS_Shape& onesh = exh.Current ();
B.Add (S,onesh);
nbsub ++;
}
@@ -110,7 +110,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
TopoDS_Shell S;
B.MakeShell (S);
for (TopoDS_Iterator it (shape); it.More(); it.Next()) {
TopoDS_Shape sh = it.Value();
const TopoDS_Shape& sh = it.Value();
newsh = Apply (sh,until,buildmode);
if (newsh.IsNull()) {
modif = -1;
@@ -118,7 +118,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
else if (newsh.ShapeType() != TopAbs_FACE) {
Standard_Integer nbsub = 0;
for (TopExp_Explorer exf(newsh,TopAbs_FACE); exf.More(); exf.Next()) {
TopoDS_Shape onesh = exf.Current ();
const TopoDS_Shape& onesh = exf.Current ();
B.Add (S,onesh);
nbsub ++;
}
@@ -189,7 +189,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
// apply recorded modifications to subshapes
for ( TopoDS_Iterator it(shape,Standard_False); it.More(); it.Next() ) {
TopoDS_Shape sh = it.Value();
const TopoDS_Shape& sh = it.Value();
newsh = Apply ( sh, until );
if ( newsh != sh ) {
if ( ShapeExtend::DecodeStatus ( myStatus, ShapeExtend_DONE4 ) )
@@ -207,7 +207,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape,
}
Standard_Integer nitems = 0;
for ( TopoDS_Iterator subit(newsh); subit.More(); subit.Next(), nitems++ ) {
TopoDS_Shape subsh = subit.Value();
const TopoDS_Shape& subsh = subit.Value();
if ( subsh.ShapeType() == sh.ShapeType() ) B.Add ( result, subsh );
else locStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL1 );
}