Changeset 44666


Ignore:
Timestamp:
Apr 21, 2008, 1:39:06 AM (10 years ago)
Author:
chris_kohlhoff
Message:

Improve efficiency of basic_streambuf::consume() by using a single call to
gbump() rather than calling sbumpc() in a loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/boost/asio/basic_streambuf.hpp

    r43472 r44666  
    102102  void consume(std::size_t n)
    103103  {
    104     while (n > 0)
    105     {
    106       sbumpc();
    107       --n;
    108     }
     104    if (gptr() + n > pptr())
     105      n = pptr() - gptr();
     106    gbump(static_cast<int>(n));
    109107  }
    110108
Note: See TracChangeset for help on using the changeset viewer.