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

@@ -986,8 +986,8 @@ TopoDS_Wire BRepFill::InsertACR(const TopoDS_Wire& wire,
}
}
TopoDS_Edge E = anExp.Current();
TopoDS_Vertex V = anExp.CurrentVertex();
const TopoDS_Edge& E = anExp.Current();
const TopoDS_Vertex& V = anExp.CurrentVertex();
if (ndec==0 || BRep_Tool::Degenerated(E)) {
// copy the edge

View File

@@ -128,7 +128,7 @@ static void AddNewEdge(const TopoDS_Shape& theEdge,
const TopTools_SequenceOfShape& NewEdges = theEdgeNewEdges(theEdge);
for (Standard_Integer i = 1; i <= NewEdges.Length(); i++)
{
TopoDS_Shape anEdge = NewEdges(i);
const TopoDS_Shape& anEdge = NewEdges(i);
AddNewEdge(anEdge, theEdgeNewEdges, ListNewEdges);
}
}
@@ -1309,7 +1309,7 @@ void BRepFill_CompatibleWires::
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itmap(myMap);
for (; itmap.More(); itmap.Next())
{
TopoDS_Shape anEdge = itmap.Key();
const TopoDS_Shape& anEdge = itmap.Key();
TopTools_ListOfShape ListOfNewEdges;
//for each edge of <myMap> find all newest edges

View File

@@ -711,7 +711,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face& Sp,
for (WireExp.Init(TopoDS::Wire(FaceExp.Current())); WireExp.More();
WireExp.Next()) {
TopoDS_Edge CurrentEdge = WireExp.Current();
const TopoDS_Edge& CurrentEdge = WireExp.Current();
TopoDS_Vertex VFirst,VLast;
EdgeVertices(CurrentEdge,VFirst,VLast);
@@ -2139,7 +2139,7 @@ void BRepFill_Evolved::MakeSolid()
B.MakeCompound(Res);
for (; exp.More(); exp.Next()) {
TopoDS_Shape Sh = exp.Current();
const TopoDS_Shape& Sh = exp.Current();
B.MakeSolid(Sol);
B.Add(Sol,Sh);
BRepClass3d_SolidClassifier SC(Sol);

View File

@@ -59,7 +59,7 @@
#include <TopoDS_Wire.hxx>
#include <Geom_Surface.hxx>
static gp_Vec MakeFinVec( const TopoDS_Wire aWire, const TopoDS_Vertex aVertex )
static gp_Vec MakeFinVec( const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex )
{
TopoDS_Vertex Vfirst, Vlast, Origin;
BRepTools_WireExplorer Explo( aWire );

View File

@@ -655,7 +655,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
}
#endif
Geom2dAdaptor_Curve Cu1 = TheV;
const Geom2dAdaptor_Curve& Cu1 = TheV;
Geom2dAdaptor_Curve Cu2( Line);
Standard_Real TolConf = 0.;

View File

@@ -570,7 +570,7 @@ void BRepFill_OffsetWire::Perform (const Standard_Real Offset,
TopoDS_Iterator itws( myWorkSpine );
for (; itws.More(); itws.Next())
{
TopoDS_Shape aWire = itws.Value();
const TopoDS_Shape& aWire = itws.Value();
aSubst.Build( aWire );
if (aSubst.IsCopied(aWire))
{

View File

@@ -746,7 +746,7 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
TopExp_Explorer Explo(result, TopAbs_FACE);
for (; Explo.More(); Explo.Next())
{
TopoDS_Shape aFace = Explo.Current();
const TopoDS_Shape& aFace = Explo.Current();
RebuildTopOrBottomFace(aFace.Reversed(), Standard_True); //top face was reversed
}
/////
@@ -987,7 +987,7 @@ void BRepFill_Pipe::RebuildTopOrBottomFace(const TopoDS_Shape& aFace,
TopoDS_Iterator itw(aWire);
for (; itw.More(); itw.Next())
{
TopoDS_Shape anEdge = itw.Value();
const TopoDS_Shape& anEdge = itw.Value();
for (ii = myCurIndexOfSectionEdge; ii <= mySections->ColLength(); ii++)
{
TopoDS_Shape aVisoEdge = mySections->Value(ii, IndexOfSection);

View File

@@ -1116,7 +1116,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
for (; Explo.More(); Explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
TopTools_ListOfShape aNewEdges = Georges.GeneratedShapes(anEdge);
const TopTools_ListOfShape& aNewEdges = Georges.GeneratedShapes(anEdge);
myEdgeNewEdges.Bind(anEdge, aNewEdges);
}
}
@@ -1168,7 +1168,7 @@ void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
Sec.Vertex(),
Sec.WithContact(),
Sec.WithCorrection());
TopoDS_Wire TmpWire = Sec.Wire();
const TopoDS_Wire& TmpWire = Sec.Wire();
aTrsf = Place.Transformation();
//Transform the copy
W = TopoDS::Wire(BRepBuilderAPI_Transform(TmpWire, aTrsf, Standard_True));

View File

@@ -798,7 +798,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
const Handle(IntTools_Context) aNullCtx;
if (BOPTools_AlgoTools::IsMicroEdge(E, aNullCtx))
{
TopoDS_Vertex aV = VF;
const TopoDS_Vertex& aV = VF;
B.UpdateVertex(aV, P1.Distance(P2));
B.MakeEdge(E);
B.UpdateEdge(E, C2d, S, TopLoc_Location(), Tol);

View File

@@ -180,8 +180,8 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
Standard_Real Tol = Precision::Confusion();
// Standard_Real TolC = 1.e-9;
Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC);
const Geom2dAdaptor_Curve& CBis(Bis);
const Geom2dAdaptor_Curve& CAC (AC);
//Intersector = Geom2dInt_GInter(CBis, CAC, TolC, Tol);
Intersector = Geom2dInt_GInter(CAC, CBis, Tol, Tol);
@@ -245,8 +245,8 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
Geom2dInt_GInter Intersector;
Standard_Real TolC = Tol;
Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC);
const Geom2dAdaptor_Curve& CBis(Bis);
const Geom2dAdaptor_Curve& CAC (AC);
Intersector = Geom2dInt_GInter(CAC, CBis, TolC, Tol);

View File

@@ -571,7 +571,7 @@ BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer
aIt.Initialize(aLP);
for ( ; aIt.More(); aIt.Next()) {
const BOPDS_Pave& aPave = aIt.Value();
TopoDS_Shape aV = theDS->Shape(aPave.Index());
const TopoDS_Shape& aV = theDS->Shape(aPave.Index());
if(aV.IsSame(alonevertices.First())) {
if(!bfound1) {