From ff41864cd967f3b0fe2aaa8dae37c5214aa1dbb8 Mon Sep 17 00:00:00 2001 From: nw13slx Date: Mon, 13 Dec 2021 15:28:27 -0500 Subject: [PATCH] remove redundant deletes --- src/reader_native.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 946b138dd6..7c7d351d74 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -79,7 +79,6 @@ int ReaderNative::read_time(bigint &ntimestep) // first bigint encodes negative format name length bigint magic_string_len = -ntimestep; - delete[] magic_string; magic_string = new char[magic_string_len + 1]; read_buf(magic_string, sizeof(char), magic_string_len); magic_string[magic_string_len] = '\0'; @@ -147,10 +146,6 @@ void ReaderNative::skip() skip_buf(n*sizeof(double)); } - delete[] magic_string; - delete[] unit_style; - magic_string = nullptr; - unit_style = nullptr; } else { read_lines(2); bigint natoms; @@ -255,7 +250,6 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, if (len > 0) { // has units - delete[] unit_style; unit_style = new char[len + 1]; read_buf(unit_style, sizeof(char), len); unit_style[len] = '\0'; @@ -487,10 +481,6 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) m+=size_one; } } - delete[] magic_string; - delete[] unit_style; - magic_string = nullptr; - unit_style = nullptr; } else { int i,m;