修改Map::Get函数名称为GetBySerial以避免可能的错误

This commit is contained in:
hyzboy 2020-06-28 22:14:28 +08:00
parent 5524bc7ebb
commit bb66ce1f5a
2 changed files with 5 additions and 3 deletions

View File

@ -239,7 +239,7 @@ namespace hgl
* @return
*/
template<typename F,typename T,typename DataPair>
bool _Map<F,T,DataPair>::Get(int index,F &f,T &t) const
bool _Map<F,T,DataPair>::GetBySerial(int index,F &f,T &t) const
{
if(index<0||index>=data_list.GetCount())return(false);

View File

@ -94,7 +94,7 @@ namespace hgl
}
IDItem *GetItem(int n){return GetListObject(data_list,n);} ///<取指定序号的数据
bool Get(int,F &,T &) const; ///<取指定序号的数据
bool GetBySerial(int,F &,T &) const; ///<取指定序号的数据
bool GetKey(int,F &); ///<取指定序号的索引
bool GetValue(int,T &); ///<取指定序号的数据
@ -136,7 +136,9 @@ namespace hgl
void DeleteObject(DataPair *ds)
{
if(!ds)return;
DeleteObject(ds->left,ds->right);
if(ds->right) ///<存在数据就是nullptr的可能
DeleteObject(ds->left,ds->right);
}
void DeleteObject(int index)