use Contains instead of IsMember/IsExist

This commit is contained in:
hyzboy 2024-09-30 23:31:05 +08:00
parent 1e121c1b3e
commit f7dce03048
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ namespace hgl
public:
const bool IsExist (const UTF8String &name)const{return attrs_map.KeyExist(name);}
const bool Contains (const UTF8String &name)const{return attrs_map.ContainsKey(name);}
const u8char * ToCString (const UTF8String &name){const AttrItem *ai=GetAttrItem(name);return(ai?ai->value.c_str():nullptr);}
const u8char * operator[] (const UTF8String &name){return ToCString(name);}

View File

@ -11,7 +11,7 @@ namespace hgl
const UTF8String &name=ec->GetElementName().ToLowerCase();
if(name.IsEmpty())return(false);
if(ecs_map.KeyExist(name))return(false);
if(ecs_map.ContainsKey(name))return(false);
ecs_map.Add(name,ec);
return(true);