From 96f1e69c71c3c9a208265684d2092aa47bfd3efd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 28 Mar 2022 13:42:55 +0100 Subject: [PATCH] Stream_support: Move string out of the loop and call clear() --- Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h index dd3d704b950..b6afd558fef 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h @@ -37,6 +37,7 @@ class File_scanner_OFF std::vector entries; std::size_t color_entries; std::size_t first_color_index; + std::string line; std::istream& m_in; bool normals_read; @@ -78,7 +79,7 @@ public: else { skip_comment(); - std::string line; + line.clear(); std::getline(m_in, line); // First remove the comment if there is one std::size_t pos = line.find('#'); @@ -692,7 +693,7 @@ public: else { skip_comment(); - std::string line; + line.clear(); std::getline(m_in, line); // First remove the comment if there is one std::size_t pos = line.find('#');