Skip to content

Commit b497e7b

Browse files
authored
Fix compile warning of iteration index(int) undefined behavior (deepmodeling#6874)
1 parent c76692f commit b497e7b

File tree

1 file changed

+2
-2
lines changed
  • source/source_hamilt/module_vdw

1 file changed

+2
-2
lines changed

source/source_hamilt/module_vdw/vdwd2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class Vdwd2 : public Vdw
3636
int yidx = para_.period().y / 2;
3737
int zidx = para_.period().z / 2;
3838

39-
for (int it1 = 0; it1 != ucell_.ntype; ++it1)
39+
for (int it1 = 0; it1 < ucell_.ntype; ++it1)
4040
{
41-
for (int it2 = 0; it2 != ucell_.ntype; ++it2)
41+
for (int it2 = 0; it2 < ucell_.ntype; ++it2)
4242
{
4343
const double C6_product
4444
= sqrt(para_.C6().at(ucell_.atoms[it1].ncpp.psd) * para_.C6().at(ucell_.atoms[it2].ncpp.psd))

0 commit comments

Comments
 (0)