Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jul 17, 2024
1 parent a6781e4 commit 52353a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/common/folding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ wstring applyWhitespaceAndPunctOnly( wstring const & in )
bool isWhitespace( wchar ch )
{
//invisible character should be treated as whitespace as well.
return QChar::isSpace( ch )|| !QChar::isPrint( ch );
return QChar::isSpace( ch ) || !QChar::isPrint( ch );
}

bool isWhitespaceOrPunct( wchar ch )
Expand All @@ -183,14 +183,13 @@ wstring trimWhitespaceOrPunct( wstring const & in )
wstring::size_type wordSize = in.size();

// Skip any leading whitespace
while ( *wordBegin && Folding::isWhitespaceOrPunct( *wordBegin ) ) {
while ( *wordBegin && Folding::isWhitespaceOrPunct( *wordBegin ) ) {
++wordBegin;
--wordSize;
}

// Skip any trailing whitespace
while ( wordSize
&& Folding::isWhitespaceOrPunct( wordBegin[ wordSize - 1 ] ) )
while ( wordSize && Folding::isWhitespaceOrPunct( wordBegin[ wordSize - 1 ] ) )
--wordSize;

return wstring( wordBegin, wordSize );
Expand Down
3 changes: 2 additions & 1 deletion src/common/globalregex.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ bool containHtmlEntity( std::string const & text );

const static QRegularExpression accentMark( R"(\p{M})", QRegularExpression::UseUnicodePropertiesOption );
//contain unicode space mark,invisible, and punctuation
const static QRegularExpression markPuncSpace( R"([\p{M}\p{Z}\p{C}\p{P}])", QRegularExpression::UseUnicodePropertiesOption );
const static QRegularExpression markPuncSpace( R"([\p{M}\p{Z}\p{C}\p{P}])",
QRegularExpression::UseUnicodePropertiesOption );
//contain unicode space and mark.invisible
const static QRegularExpression markSpace( R"([\p{M}\p{Z}\p{C}])", QRegularExpression::UseUnicodePropertiesOption );

Expand Down

0 comments on commit 52353a5

Please sign in to comment.