Add ssize and remove static_casts
[alexxy/gromacs.git] / src / gromacs / topology / mtop_lookup.h
index 558ceb6163c0273acab5f9dd1c5205311094213a..9926cd5171168489e7a12c313ce5f5b73f563bdc 100644 (file)
@@ -78,7 +78,7 @@ mtopGetMolblockIndex(const gmx_mtop_t *mtop,
 {
     GMX_ASSERT(globalAtomIndex >= 0 && globalAtomIndex < mtop->natoms, "The atom index to look up should be within range");
     GMX_ASSERT(moleculeBlock != nullptr, "molBlock can not be NULL");
-    GMX_ASSERT(*moleculeBlock >= 0 && *moleculeBlock < static_cast<int>(mtop->moleculeBlockIndices.size()), "The starting molecule block index for the search should be within range and moleculeBlockIndices should not be empty");
+    GMX_ASSERT(*moleculeBlock >= 0 && *moleculeBlock < gmx::ssize(mtop->moleculeBlockIndices), "The starting molecule block index for the search should be within range and moleculeBlockIndices should not be empty");
 
     /* Search the molecule block index using bisection */
     int molBlock0 = -1;