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

@@ -58,7 +58,7 @@ static void BuildBack (const TopTools_DataMapOfShapeListOfShape& M1,
//=======================================================================
static void Replace ( TopTools_ListOfShape& L,
const TopoDS_Shape Old,
const TopoDS_Shape& Old,
const TopTools_ListOfShape& New)
{
//-----------------------------------
@@ -150,7 +150,7 @@ static void Update ( TopTools_DataMapOfShapeListOfShape& Mod,
if (!LIG.IsEmpty()) {
if (ModBack.IsBound(S)) {
// Generation de modif => generation du shape initial
TopoDS_Shape IS = ModBack(S);
const TopoDS_Shape& IS = ModBack(S);
StoreImage (Gen,IS,GenBack,LIG);
}
else {

View File

@@ -237,7 +237,7 @@ void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange
gp_Pln aPln(myMesh->Node(anIdx[0]), aNorm);
BRepBuilderAPI_MakeFace aFaceMaker(aPln, aWire);
const TopoDS_Face aFace = aFaceMaker.Face();
const TopoDS_Face& aFace = aFaceMaker.Face();
aBB.Add(aResult, aFace);
}

View File

@@ -374,7 +374,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge,
for (Standard_Integer i = 1; i <= seqEdges.Length(); i++) {
// Retrieve candidate section
TopoDS_Shape oedge2 = seqEdges(i);
const TopoDS_Shape& oedge2 = seqEdges(i);
if (mySewing) {
@@ -1393,7 +1393,7 @@ void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape&
// (they have other nearest edges belonging to the work face)
for(Standard_Integer k = 1; k<= seqNotCandidate.Length(); k++) {
Standard_Integer index1 = seqNotCandidate.Value(k);
TopoDS_Shape edge = sequenceSec.Value(index1);
const TopoDS_Shape& edge = sequenceSec.Value(index1);
TopTools_SequenceOfShape tmpSeq;
tmpSeq.Append(edge);
for(Standard_Integer kk = 1; kk <= seqIndCandidate.Length();kk++)
@@ -2928,7 +2928,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Message_ProgressRange& theP
for (i = 1; i <= myBoundFaces.Extent(); i++) {
TopoDS_Shape bound = myBoundFaces.FindKey(i);
for (TopoDS_Iterator itv(bound,Standard_False); itv.More(); itv.Next()) {
TopoDS_Shape node = itv.Value();
const TopoDS_Shape& node = itv.Value();
if (myNodeSections.IsBound(node))
myNodeSections(node).Append(bound);
else {
@@ -2991,7 +2991,7 @@ static void replaceNMVertices(const TopoDS_Edge& theEdge,
theReShape->Replace(aSeqNMVert.Value(i),theV2);
continue;
}
TopoDS_Shape aV = aSeqNMVert.Value(i);
const TopoDS_Shape& aV = aSeqNMVert.Value(i);
Standard_Integer j =1;
for( ; j <= aEdParams.Length();j++) {
Standard_Real apar2 = aEdParams.Value(j);
@@ -3508,7 +3508,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
TopTools_MapOfShape mapEdges;
mapEdges.Add(edge);
for (Standard_Integer i = 1; i <= mapVert1.Extent(); i++) {
TopoDS_Shape node1 = mapVert1.FindKey(i);
const TopoDS_Shape& node1 = mapVert1.FindKey(i);
if (!myNodeSections.IsBound(node1)) continue;
TopTools_ListIteratorOfListOfShape ilsec(myNodeSections(node1));
for (; ilsec.More(); ilsec.Next()) {
@@ -4453,7 +4453,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape&
if (jdist < 0.0) {
// Bind new cutting node (end vertex only)
seqDist.SetValue(indexMin,disProj);
TopoDS_Shape cvertex = seqVert.Value(indexMin);
const TopoDS_Shape& cvertex = seqVert.Value(indexMin);
NodeCuttingVertex.Add(node,cvertex);
}
else {