This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Assign(_str, _pos, _n) (take2) + benchmarks


Nathan Myers wrote:

> What if pos is zero?  The code as written will work, and will just
> call move() unnecessarily, which on x86 appears to run through the
> loop copying all the characters in place.  I don't know whether it's
> worth optimizing for.

Thanks for your feedback. Indeed, I think that pos == 0 can be a relatively
common case and if move is not sufficiently smart ;-) we'll take care of this!

In a few hours I will submit a next round including also an optimized
assign(const _CharT* __s, size_type __n).

Cheers,
Paolo.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]