diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-08 18:04:16 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-08 18:04:16 +0000 |
commit | f2467c5915867c006aa16fd22e482816e029a2db (patch) | |
tree | 61d8fcb4aa8a71d9034ff510ee52b2b7ca13fb5c /ACE/ace/String_Base.cpp | |
parent | a2b8eda5d51dca5496c94600a7d3082b1a5f3601 (diff) | |
download | ATCD-ReDaC_01.tar.gz |
made a copyReDaC_01
Diffstat (limited to 'ACE/ace/String_Base.cpp')
-rw-r--r-- | ACE/ace/String_Base.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/ACE/ace/String_Base.cpp b/ACE/ace/String_Base.cpp index 525dcbc2553..01de0963b72 100644 --- a/ACE/ace/String_Base.cpp +++ b/ACE/ace/String_Base.cpp @@ -267,29 +267,19 @@ ACE_String_Base<CHAR>::resize (typename ACE_String_Base<CHAR>::size_type len, { ACE_TRACE ("ACE_String_Base<CHAR>::resize"); - fast_resize(len); - ACE_OS::memset (this->rep_, c, this->buf_len_ * sizeof (CHAR)); -} - -template <class CHAR> void -ACE_String_Base<CHAR>::fast_resize (size_t len) -{ - ACE_TRACE ("ACE_String_Base<CHAR>::fast_resize"); - // Only reallocate if we don't have enough space... if (this->buf_len_ <= len) { - if (this->buf_len_ != 0 && this->release_ != 0) + if (this->buf_len_ != 0 && this->release_ != 0) this->allocator_->free (this->rep_); - this->rep_ = static_cast<CHAR*> - (this->allocator_->malloc ((len + 1) * sizeof (CHAR))); + this->rep_ = static_cast<CHAR*>( + this->allocator_->malloc ((len + 1) * sizeof (CHAR))); this->buf_len_ = len + 1; this->release_ = 1; } this->len_ = 0; - if (len > 0) - this->rep_[0] = 0; + ACE_OS::memset (this->rep_, c, this->buf_len_ * sizeof (CHAR)); } template <class CHAR> void |