Skip to content

Commit a610710

Browse files
authored
Merge pull request #62 from TAImatem/master
removed std::endl calls which were causing significant slowdown when writing
2 parents 4273153 + 419381d commit a610710

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/intern/dxfwriter.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ dxfWriterAscii::dxfWriterAscii(std::ofstream *stream):dxfWriter(stream){
221221
bool dxfWriterAscii::writeString(int code, std::string text) {
222222
// *filestr << code << std::endl << text << std::endl ;
223223
filestr->width(3);
224-
*filestr << std::right << code << std::endl;
224+
*filestr << std::right << code << '\n';
225225
filestr->width(0);
226-
*filestr << std::left << text << std::endl;
226+
*filestr << std::left << text << '\n';
227227
/* std::getline(*filestr, strData, '\0');
228228
DBG(strData); DBG("\n");*/
229229
return (filestr->good());
@@ -232,9 +232,9 @@ bool dxfWriterAscii::writeString(int code, std::string text) {
232232
bool dxfWriterAscii::writeInt16(int code, int data) {
233233
// *filestr << std::right << code << std::endl << data << std::endl;
234234
filestr->width(3);
235-
*filestr << std::right << code << std::endl;
235+
*filestr << std::right << code << '\n';
236236
filestr->width(5);
237-
*filestr << data << std::endl;
237+
*filestr << data << '\n';
238238
return (filestr->good());
239239
}
240240

@@ -245,9 +245,9 @@ bool dxfWriterAscii::writeInt32(int code, int data) {
245245
bool dxfWriterAscii::writeInt64(int code, unsigned long long int data) {
246246
// *filestr << code << std::endl << data << std::endl;
247247
filestr->width(3);
248-
*filestr << std::right << code << std::endl;
248+
*filestr << std::right << code << '\n';
249249
filestr->width(5);
250-
*filestr << data << std::endl;
250+
*filestr << data << '\n';
251251
return (filestr->good());
252252
}
253253

@@ -256,15 +256,15 @@ bool dxfWriterAscii::writeDouble(int code, double data) {
256256
// filestr->precision(12);
257257
// *filestr << code << std::endl << data << std::endl;
258258
filestr->width(3);
259-
*filestr << std::right << code << std::endl;
260-
*filestr << data << std::endl;
259+
*filestr << std::right << code << '\n';
260+
*filestr << data << '\n';
261261
// filestr->precision(prec);
262262
return (filestr->good());
263263
}
264264

265265
//saved as int or add a bool member??
266266
bool dxfWriterAscii::writeBool(int code, bool data) {
267-
*filestr << code << std::endl << data << std::endl;
267+
*filestr << code << '\n' << data << '\n';
268268
return (filestr->good());
269269
}
270270

0 commit comments

Comments
 (0)