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

@@ -589,7 +589,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
TopoDS_Iterator it(Result1);
for ( ; it.More(); it.Next() )
{
TopoDS_Shape aSubShape = it.Value();
const TopoDS_Shape& aSubShape = it.Value();
B.Add(Cund, aSubShape);
}
}
@@ -639,7 +639,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
TopoDS_Iterator it(Result1);
for ( ; it.More(); it.Next() )
{
TopoDS_Shape aSubShape = it.Value();
const TopoDS_Shape& aSubShape = it.Value();
B.Add(Cund, aSubShape);
}
}
@@ -657,7 +657,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
Interface_EntityIterator subs1 = graph.Sharings(rep);
Handle(Standard_Type) tSRR = STANDARD_TYPE(StepRepr_ShapeRepresentationRelationship);
for (subs1.Start(); subs1.More(); subs1.Next()) {
Handle(Standard_Transient) anitem = subs1.Value();
const Handle(Standard_Transient)& anitem = subs1.Value();
if( !anitem->IsKind(STANDARD_TYPE(StepRepr_RepresentationRelationship)))
continue;
if (anitem->DynamicType() == tSRR)
@@ -991,7 +991,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
// Put not suspected open Shells as they are (updated 23.11.2010)
TopExp_Explorer allShellsExp(comp, TopAbs_SHELL);
for ( ; allShellsExp.More(); allShellsExp.Next() ) {
TopoDS_Shape aCurrentShell = allShellsExp.Current();
const TopoDS_Shape& aCurrentShell = allShellsExp.Current();
if ( !myNMTool.IsPureNMShell(aCurrentShell) && !shellClosingsMap.Contains(aCurrentShell) )
brepBuilder.Add(compWithClosings, aCurrentShell);
}
@@ -1005,7 +1005,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
TopExp_Explorer exp(comp, TopAbs_SHELL);
for (; exp.More(); exp.Next())
{
TopoDS_Shape aSubShape = exp.Current();
const TopoDS_Shape& aSubShape = exp.Current();
if (aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed()) {
TopoDS_Solid nextSolid;
brepBuilder.MakeSolid(nextSolid);
@@ -1348,7 +1348,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::OldWay
for (subs.Start(); subs.More() && PS.More(); subs.Next())
{
Message_ProgressRange aRange = PS.Next();
Handle(Standard_Transient) anitem = subs.Value();
const Handle(Standard_Transient)& anitem = subs.Value();
if ( anitem->DynamicType() != tCDSR && anitem->DynamicType() != tSRR ) continue;
// DeclareAndCast(StepShape_ContextDependentShapeRepresentation,anitem,subs.Value());
// if (anitem.IsNull()) continue;
@@ -2026,12 +2026,12 @@ void STEPControl_ActorRead::computeIDEASClosings(const TopoDS_Compound& comp,
TopExp_Explorer shellExpA(comp, TopAbs_SHELL);
for ( ; shellExpA.More(); shellExpA.Next() ) {
TopoDS_Shape shellA = shellExpA.Current();
const TopoDS_Shape& shellA = shellExpA.Current();
TopExp_Explorer shellExpB(comp, TopAbs_SHELL);
TopTools_ListOfShape closingShells;
for ( ; shellExpB.More(); shellExpB.Next() ) {
TopoDS_Shape shellB = shellExpB.Current();
const TopoDS_Shape& shellB = shellExpB.Current();
if ( shellA.IsSame(shellB) )
continue;
// Check whether ShellB is non-manifold and adjacent to ShellA.

View File

@@ -228,7 +228,7 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) {
TopoDS_Iterator anIt(theShape);
for ( ; anIt.More(); anIt.Next() ) {
TopoDS_Shape aDirectChild = anIt.Value();
const TopoDS_Shape& aDirectChild = anIt.Value();
if (aDirectChild.ShapeType() != TopAbs_COMPOUND)
aBrepBuilder.Add(aDirectShapes, aDirectChild);
}
@@ -791,7 +791,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
// Transfer Solids to closed Shells. Prepare RepItemSeq & NonManifoldGroup
for ( TopoDS_Iterator iter(aNMCompound); iter.More(); iter.Next() ) {
TopoDS_Shape aSubShape = iter.Value();
const TopoDS_Shape& aSubShape = iter.Value();
if (aSubShape.ShapeType() == TopAbs_SOLID) {
for ( TopoDS_Iterator aSubIter(aSubShape); aSubIter.More(); aSubIter.Next() ) {
TopoDS_Shell aSubShell = TopoDS::Shell( aSubIter.Value() );
@@ -1191,7 +1191,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
aGCSet->SetName(empty);
// iterates on compound with vertices and traces each vertex
for ( anExp.ReInit() ; anExp.More(); anExp.Next() ) {
TopoDS_Shape aVertex = anExp.Current();
const TopoDS_Shape& aVertex = anExp.Current();
if ( aVertex.ShapeType() != TopAbs_VERTEX )
continue;
curNb++;
@@ -1483,7 +1483,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound
#endif
for (TopoDS_Iterator iter(theShape); iter.More(); iter.Next()) {
TopoDS_Shape aSubShape = iter.Value();
const TopoDS_Shape& aSubShape = iter.Value();
if (aSubShape.ShapeType() != TopAbs_VERTEX || !isSeparateVertices) {
// Store non-manifold topology as shells (ssv; 10.11.2010)
@@ -1597,7 +1597,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
gp_Trsf aLoc;
Standard_Boolean isShapeLocated = Standard_False;
if ( GroupMode() >0) {
TopLoc_Location shloc = shape.Location();
const TopLoc_Location& shloc = shape.Location();
isShapeLocated = !shloc.IsIdentity();
aLoc = shloc.Transformation();
TopLoc_Location shident;
@@ -1643,7 +1643,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
// make location for assembly placement
GeomToStep_MakeAxis2Placement3d mkax (aLoc);
Handle(StepGeom_Axis2Placement3d) AxLoc = mkax.Value();
const Handle(StepGeom_Axis2Placement3d)& AxLoc = mkax.Value();
AX1 = AxLoc;
// create assembly structures (CDSR, NAUO etc.)