From cf494b4f860be8cdb1bf198f036b26db58435bb0 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 23 Apr 2025 00:15:19 +0800 Subject: [PATCH] =?UTF-8?q?DeleteMove=E6=94=B9=E5=90=8D=E4=B8=BADeleteShif?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/math/Transform.h | 2 +- inc/hgl/type/DataArray.h | 2 +- inc/hgl/type/List.h | 2 +- inc/hgl/type/Map.cpp | 4 ++-- inc/hgl/type/ObjectList.h | 6 +++--- inc/hgl/type/SortedSet.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/hgl/math/Transform.h b/inc/hgl/math/Transform.h index e1e35df..46a34ee 100644 --- a/inc/hgl/math/Transform.h +++ b/inc/hgl/math/Transform.h @@ -623,7 +623,7 @@ namespace hgl if(pos<0) return; - transform_list.DeleteMove(pos); //使用DeleteMove是为了保持顺序(Delete可能会拿最后一个数据移到前面,而本类需要保持顺序) + transform_list.DeleteShift(pos); //使用DeleteShift是为了保持顺序(Delete可能会拿最后一个数据移到前面,而本类需要保持顺序) UpdateVersion(); } diff --git a/inc/hgl/type/DataArray.h b/inc/hgl/type/DataArray.h index 93e6f5d..0e8771a 100644 --- a/inc/hgl/type/DataArray.h +++ b/inc/hgl/type/DataArray.h @@ -291,7 +291,7 @@ namespace hgl * @param start 要删除的数据项的索引值 * @return 是否成功 */ - bool DeleteMove(int64 start,int64 delete_count=1) + bool DeleteShift(int64 start,int64 delete_count=1) { if(!items)return(false); if(start>=count)return(false); diff --git a/inc/hgl/type/List.h b/inc/hgl/type/List.h index 801d0f8..ad589b6 100644 --- a/inc/hgl/type/List.h +++ b/inc/hgl/type/List.h @@ -123,7 +123,7 @@ namespace hgl virtual bool Contains(const T &flag)const{return Find(flag)>=0;} ///<确认数据项是否存在 virtual bool Delete(int start,int num=1){return data_array.Delete(start,num);} ///<删除指定索引的数据 - virtual bool DeleteMove(int start,int num=1){return data_array.DeleteMove(start,num);} ///<删除指定索引的数据,将后面紧邻的数据前移 + virtual bool DeleteShift(int start,int num=1){return data_array.DeleteShift(start,num);} ///<删除指定索引的数据,将后面紧邻的数据前移 /** * 删除列表中的指定项 diff --git a/inc/hgl/type/Map.cpp b/inc/hgl/type/Map.cpp index 16c3beb..b0912a2 100644 --- a/inc/hgl/type/Map.cpp +++ b/inc/hgl/type/Map.cpp @@ -331,7 +331,7 @@ namespace hgl data=dp->value; data_pool.Release(dp); - data_list.DeleteMove(index); + data_list.DeleteShift(index); return(true); } @@ -395,7 +395,7 @@ namespace hgl ||index>=data_list.GetCount())return(false); data_pool.Release(GetObjectFromList(data_list,index)); - data_list.DeleteMove(index); + data_list.DeleteShift(index); return(true); } diff --git a/inc/hgl/type/ObjectList.h b/inc/hgl/type/ObjectList.h index a64f2bf..f1a300d 100644 --- a/inc/hgl/type/ObjectList.h +++ b/inc/hgl/type/ObjectList.h @@ -52,7 +52,7 @@ namespace hgl } virtual bool Unlink(int index){return List::Delete(index);} ///<将指定索引处的数据与列表断开 - virtual bool UnlinkMove(int index){return List::DeleteMove(index);} ///<将指定索引处的数据与列表断开,将前移后面的数据 + virtual bool UnlinkMove(int index){return List::DeleteShift(index);} ///<将指定索引处的数据与列表断开,将前移后面的数据 virtual bool Unlink(int start,int number){return List::Delete(start,number);} ///<将指定索引处的数据与列表断开 virtual bool UnlinkByValue(ItemPointer &ip){return List::DeleteByValue(ip);} ///<将一个指定数据与列表断开 virtual void UnlinkByValue(ItemPointer *ip,int n){List::DeleteByValue(ip,n);} ///<将一批指定数据与列表断开 @@ -96,12 +96,12 @@ namespace hgl * @param num 要删除的对象数量 * @return 是否成功 */ - virtual bool DeleteMove(int index,int num=1) override + virtual bool DeleteShift(int index,int num=1) override { if(!_Delete(index,num)) return(false); - return List::DeleteMove(index,num); + return List::DeleteShift(index,num); } virtual bool DeleteByValue(ItemPointer &obj) override ///<删除指定的一个数据 diff --git a/inc/hgl/type/SortedSet.h b/inc/hgl/type/SortedSet.h index 3f8317b..fd8bcbd 100644 --- a/inc/hgl/type/SortedSet.h +++ b/inc/hgl/type/SortedSet.h @@ -116,7 +116,7 @@ namespace hgl } } - bool DeleteAt (const int64 pos){return data_list.DeleteMove(pos,1);} ///<删除一个数据,使用序号 + bool DeleteAt (const int64 pos){return data_list.DeleteShift(pos,1);} ///<删除一个数据,使用序号 bool Delete (const T &data) ///<删除一个数据 {