Changeset 16881


Ignore:
Timestamp:
06/21/13 16:05:13 (11 years ago)
Author:
tbretz
Message:
Replaced some loops with cout.write for better performance
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/WindowLog.cc

    r16832 r16881  
    5151        fMuxCout.lock();
    5252
    53         for (unsigned int i=0; i<fBacklog.size(); i++)
    54             cout << fBacklog[i];
     53        cout.write(fBacklog.data(), fBacklog.size());
    5554        cout.flush();
    5655
     
    178177    // If fWindow is set, output everything to the window, otherwise
    179178    // to cout
    180     const string sout = string(fBase, len);
    181 
    182179    if (!fIsNull)
    183180    {
     
    186183            fMuxWindow.lock();
    187184            if (!fIsNull)
     185            {
     186                const string sout = string(fBase, len);
    188187                wprintw(fWindow, "%s", sout.c_str());
     188            }
    189189            // If the stream got flushed due to a line break
    190190            // reset all attributes
     
    196196        {
    197197            fMuxCout.lock();
    198             cout << sout;
     198            cout.write(fBase, len);// << sout;
    199199            // If the stream got flushed due to a line break
    200200            // reset all attributes
     
    228228    }
    229229
    230     fQueueFile.emplace(sout);
     230    fQueueFile.emplace(fBase, len);
    231231    /*
    232232    // Output everything also to the log-file
Note: See TracChangeset for help on using the changeset viewer.