@@ -101,8 +101,7 @@ inline std::string generateTableEntry(uint32_t pinyinKey, std::string_view key,
101101}
102102
103103void maybeUnescapeValue (std::string &value) {
104- if (value.size () >= 2 && fcitx::stringutils::startsWith (value, ' "' ) &&
105- fcitx::stringutils::endsWith (value, ' "' )) {
104+ if (value.size () >= 2 && value.starts_with (' "' ) && value.ends_with (' "' )) {
106105 if (auto unescape = fcitx::stringutils::unescapeForValue (value)) {
107106 value = unescape.value ();
108107 }
@@ -112,8 +111,7 @@ void maybeUnescapeValue(std::string &value) {
112111std::string maybeEscapeValue (std::string_view value) {
113112 auto escaped = fcitx::stringutils::escapeForValue (value);
114113 if (escaped.size () != value.size ()) {
115- if (fcitx::stringutils::startsWith (escaped, " \" " ) &&
116- fcitx::stringutils::endsWith (escaped, " \" " )) {
114+ if (escaped.starts_with (" \" " ) && escaped.ends_with (" \" " )) {
117115 return escaped;
118116 }
119117 return fcitx::stringutils::concat (" \" " , escaped, " \" " );
@@ -673,7 +671,7 @@ void TableBasedDictionary::loadText(std::istream &in) {
673671
674672 switch (phase) {
675673 case BuildPhase::PhaseConfig: {
676- if (fcitx::stringutils::startsWith ( line, " #" )) {
674+ if (line. starts_with ( " #" )) {
677675 continue ;
678676 }
679677
@@ -716,7 +714,7 @@ void TableBasedDictionary::loadText(std::istream &in) {
716714 break ;
717715 }
718716 case BuildPhase::PhaseRule: {
719- if (fcitx::stringutils::startsWith ( line, " #" )) {
717+ if (line. starts_with ( " #" )) {
720718 continue ;
721719 }
722720 if (consumeOptionPrefix (line, STR_DATA)) {
0 commit comments