fixed a bug about CaseComp at String/StringInstance

This commit is contained in:
2022-03-31 21:58:55 +08:00
parent 08d2fa2a1f
commit e17d3d6b9f
3 changed files with 5 additions and 29 deletions

View File

@@ -1061,21 +1061,7 @@ namespace hgl
--dst_size;
}
if(dst_size<=0||src_size<=0)
return(0);
if(src_size)
{
if(dst_size)
return chricmp(*src,*dst);
else
return 1;
}
if(dst_size)
return -1;
else
return 0;
return src_size-dst_size;
}
/**

View File

@@ -633,10 +633,12 @@ namespace hgl
if(!data.valid())
return(bs.Length());
if(bs.Length()<=0)
const int len=bs.Length();
if(len<=0)
return 1;
return data->CaseComp(bs.data->c_str());
return data->CaseComp(bs.data->c_str(),len);
}
/**

View File

@@ -332,18 +332,6 @@ namespace hgl
return hgl::strcmp(buffer+pos,str,num);
}
/**
* 和一个字符串进行比较,英文不区分大小写
* @param sc 比较字符串
* @return <0 我方小
* @return 0 等同
* @return >0 我方大
*/
const int CaseComp(const SelfClass &sc)const
{
return hgl::stricmp(buffer,length,sc.buffer,sc.length);
}
/**
* 和那一个字符串进行比较,英文不区分大小写
* @param str 比较字符串