Skip to content

Commit 45e84d2

Browse files
committed
继续降低版本
1 parent e6698a0 commit 45e84d2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CodeService/src/NameStyle/NameStyleRuleMatcher.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "LuaParser/LuaTokenTypeDetail.h"
44
#include "Util/format.h"
55
#include "CodeService/LanguageTranslator.h"
6-
6+
#include "Util/StringUtil.h"
77

88
NameStyleRuleMatcher::NameStyleRule::NameStyleRule(NameStyleType type)
99
: Type(type)
@@ -433,7 +433,8 @@ bool NameStyleRuleMatcher::Same(DiagnosisContext& ctx, std::shared_ptr<CheckElem
433433
return SameSimple(filename, checkElement);
434434
}
435435
}
436-
else if (firstParam.size() > 2 && (firstParam.starts_with("\'") || firstParam.starts_with("\"")))
436+
else if (firstParam.size() > 2 && (StringUtil::StartWith(firstParam, "\'") || StringUtil::StartWith(
437+
firstParam, "\"")))
437438
{
438439
auto name = firstParam.substr(1, firstParam.size() - 2);
439440
return checkElement->Node->GetText() == name;
@@ -488,7 +489,7 @@ bool NameStyleRuleMatcher::SameCamel(std::string_view text, std::shared_ptr<Chec
488489

489490
for (auto it = textParts.rbegin(); it != textParts.rend(); ++it)
490491
{
491-
if (checkText.ends_with(*it))
492+
if (StringUtil::EndWith(checkText, *it))
492493
{
493494
if (checkText.size() == it->size())
494495
{
@@ -518,7 +519,7 @@ bool NameStyleRuleMatcher::SamePascal(std::string_view text, std::shared_ptr<Che
518519

519520
for (auto it = textParts.rbegin(); it != textParts.rend(); --it)
520521
{
521-
if (checkText.ends_with(*it))
522+
if (StringUtil::EndWith(checkText, *it))
522523
{
523524
if (checkText.size() == it->size())
524525
{

0 commit comments

Comments
 (0)