This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Assign(_str, _pos, _n) (take2) + benchmarks
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Nathan Myers <ncm-nospam at cantrip dot org>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 15 Dec 2001 11:48:21 +0100
- Subject: Re: [PATCH] Assign(_str, _pos, _n) (take2) + benchmarks
- References: <3C19E5C6.9645C13D@unitus.it> <20011215100916.A31933@cantrip.org>
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.