From e35fee68f0e9b1626cb249bc45b16c2e5d4d4b06 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 23 Oct 2003 21:00:47 +0000 Subject: [PATCH] Fix slow score writing. f << endl; is roughly equivalent to fprintf(f, "\n"; fflush(f);. Never use endl unless you really, explicitly want to flush the stream. --- stepmania/src/SongManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index e98110619c..2e6e9627fa 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -348,19 +348,19 @@ bool FileRead( ifstream& f, float& fOut ) } void FileWrite( ofstream& f, const CString& sWrite ) { - f << sWrite << endl; + f << sWrite << "\n"; } void FileWrite( ofstream& f, int iWrite ) { - f << iWrite << endl; + f << iWrite << "\n"; } void FileWrite( ofstream& f, size_t uWrite ) { - f << uWrite << endl; + f << uWrite << "\n"; } void FileWrite( ofstream& f, float fWrite ) { - f << fWrite << endl; + f << fWrite << "\n"; } #define WARN_AND_RETURN { LOG->Warn("Error parsing file '%s' at %s:%d",fn.c_str(),__FILE__,__LINE__); return; }