From a942d8b3ba0bfb784bb71e091e7ef5ae1af38c59 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 14 Nov 2018 05:30:23 -0500 Subject: [PATCH] use memset() for clearing of arrays --- src/read_data.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 1dbb9506c6..373ba30151 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1248,7 +1248,7 @@ void ReadData::bonds(int firstpass) int *count = NULL; if (firstpass) { memory->create(count,nlocal,"read_data:count"); - for (int i = 0; i < nlocal; i++) count[i] = 0; + memset(count,0,nlocal*sizeof(int)); } // read and process bonds @@ -1331,7 +1331,7 @@ void ReadData::angles(int firstpass) int *count = NULL; if (firstpass) { memory->create(count,nlocal,"read_data:count"); - for (int i = 0; i < nlocal; i++) count[i] = 0; + memset(count,0,nlocal*sizeof(int)); } // read and process angles @@ -1414,7 +1414,7 @@ void ReadData::dihedrals(int firstpass) int *count = NULL; if (firstpass) { memory->create(count,nlocal,"read_data:count"); - for (int i = 0; i < nlocal; i++) count[i] = 0; + memset(count,0,nlocal*sizeof(int)); } // read and process dihedrals @@ -1497,7 +1497,7 @@ void ReadData::impropers(int firstpass) int *count = NULL; if (firstpass) { memory->create(count,nlocal,"read_data:count"); - for (int i = 0; i < nlocal; i++) count[i] = 0; + memset(count,0,nlocal*sizeof(int)); } // read and process impropers