From b4c0201266848b5030f2490f40195499b02cd2f7 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Wed, 13 Sep 2023 12:14:12 +0800 Subject: [PATCH] added "SortedSets::Add(T *,count)" function --- inc/hgl/type/SortedSets.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/inc/hgl/type/SortedSets.h b/inc/hgl/type/SortedSets.h index 48f946f..4adb95e 100644 --- a/inc/hgl/type/SortedSets.h +++ b/inc/hgl/type/SortedSets.h @@ -84,6 +84,37 @@ namespace hgl } } + /* + * 添加一批数据 + */ + int Add (T *dl,const int count) + { + if(!dl||count<=0)return -1; + + if(count==1) + return Add(*dl); + + data_list.Alloc(data_list.GetCount()+count); + + { + int pos; + int result=0; + + for(int i=0;i