commit 2025-09-29 19:47 bug fix in ZtCBaseList::operator=(const ZtCBaseList& rhs) : ZCppMain/ZMainHead.H
This commit is contained in:
@ -5498,13 +5498,16 @@ namespace ZNsMain
|
|||||||
|
|
||||||
ZtCBaseList& operator=(const ZtCBaseList& rhs)
|
ZtCBaseList& operator=(const ZtCBaseList& rhs)
|
||||||
{
|
{
|
||||||
|
// 초기에 DeleteAll() 로 다 삭제하고 필요한 만큼 AddTail()
|
||||||
|
// 을 호출하고 있는데, 최적화의 여지가 있다.
|
||||||
|
|
||||||
if(this==&rhs) return *this; this->DeleteAll();
|
if(this==&rhs) return *this; this->DeleteAll();
|
||||||
|
|
||||||
ZCLink* VP_NowLink = rhs.mp_HeadLink ;
|
ZCLink* VP_NowLink = rhs.mp_HeadLink ;
|
||||||
|
|
||||||
__for0(TypeSize, i, rhs.size())
|
__for0(TypeSize, i, rhs.size())
|
||||||
{
|
{
|
||||||
this->AddHead(VP_NowLink->mo_Data) ;
|
this->AddTail(VP_NowLink->mo_Data) ;
|
||||||
|
|
||||||
VP_NowLink = VP_NowLink->mp_NextLink;
|
VP_NowLink = VP_NowLink->mp_NextLink;
|
||||||
}/*
|
}/*
|
||||||
|
Reference in New Issue
Block a user