0030550: Coding - Integer overflow in Standard_CString HashCodes
[occt.git] / src / StepToTopoDS / StepToTopoDS_PointPairHasher.cxx
index ae20c0a..22324ec 100644 (file)
 #include <StepToTopoDS_PointPairHasher.hxx>
 
 //=======================================================================
-//function : HashCode
-//purpose  : 
+// function : HashCode
+// purpose  :
 //=======================================================================
-Standard_Integer StepToTopoDS_PointPairHasher::HashCode
-  (const StepToTopoDS_PointPair& P, const Standard_Integer Upper)
+Standard_Integer StepToTopoDS_PointPairHasher::HashCode (const StepToTopoDS_PointPair& thePointPair,
+                                                         const Standard_Integer        theUpperBound)
 {
-  return (::HashCode(P.myP1,Upper) + ::HashCode(P.myP2,Upper)) % Upper;
+  return ::HashCode (::HashCode (thePointPair.myP1, theUpperBound) + ::HashCode (thePointPair.myP2, theUpperBound),
+                     theUpperBound);
 }
 
 //=======================================================================