Revert "fix warning: unused variable ‘i’"

This reverts commit 562ac207b5b6583a2981e1d165b40484230c8972.