From 92d2763d4027be53205cb1b91d96a13bda617741 Mon Sep 17 00:00:00 2001 From: sauron Date: Mon, 29 Sep 2025 19:47:52 +0900 Subject: [PATCH] commit 2025-09-29 19:47 bug fix in ZtCBaseList::operator=(const ZtCBaseList& rhs) : ZCppMain/ZMainHead.H --- ZCppMain/ZMainHead.H | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index a40cfda..67d43e5 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -5498,13 +5498,16 @@ namespace ZNsMain ZtCBaseList& operator=(const ZtCBaseList& rhs) { + // 초기에 DeleteAll() 로 다 삭제하고 필요한 만큼 AddTail() + // 을 호출하고 있는데, 최적화의 여지가 있다. + if(this==&rhs) return *this; this->DeleteAll(); ZCLink* VP_NowLink = rhs.mp_HeadLink ; __for0(TypeSize, i, rhs.size()) { - this->AddHead(VP_NowLink->mo_Data) ; + this->AddTail(VP_NowLink->mo_Data) ; VP_NowLink = VP_NowLink->mp_NextLink; }/*