0030550: Coding - Integer overflow in Standard_CString HashCodes
[occt.git] / src / BRepMesh / BRepMesh_OrientedEdge.hxx
index 94b8fc3..976c1ba 100644 (file)
@@ -54,12 +54,12 @@ public:
     return myLastNode;
   }
 
-  //! Returns hash code for this edge.
-  //! @param theUpper upper index in the container.
-  //! @return hash code.
-  inline Standard_Integer HashCode(const Standard_Integer theUpper) const
+  //! Computes a hash code for this oriented edge, in the range [1, theUpperBound]
+  //! @param theUpperBound the upper bound of the range a computing hash code must be within
+  //! @return a computed hash code, in the range [1, theUpperBound]
+  inline Standard_Integer HashCode (const Standard_Integer theUpperBound) const
   {
-    return ::HashCode(myFirstNode + myLastNode, theUpper);
+    return ::HashCode (myFirstNode + myLastNode, theUpperBound);
   }
 
   //! Checks this and other edge for equality.
@@ -82,10 +82,13 @@ private:
   Standard_Integer myLastNode;
 };
 
-inline Standard_Integer HashCode(const BRepMesh_OrientedEdge&   theEdge,
-                                 const Standard_Integer         theUpper)
+//! Computes a hash code for the given oriented edge, in the range [1, theUpperBound]
+//! @param theOrientedEdge the oriented edge which hash code is to be computed
+//! @param theUpperBound the upper bound of the range a computing hash code must be within
+//! @return a computed hash code, in the range [1, theUpperBound]
+inline Standard_Integer HashCode (const BRepMesh_OrientedEdge& theOrientedEdge, const Standard_Integer theUpperBound)
 {
-  return theEdge.HashCode(theUpper);
+  return theOrientedEdge.HashCode (theUpperBound);
 }
 
 #endif