From a6781e47dc16081815bf9211a80e9727ed24cf63 Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Wed, 17 Jul 2024 10:14:32 +0800 Subject: [PATCH] opt: whitespace and punct character --- src/common/folding.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/folding.cc b/src/common/folding.cc index 4fc609469..bb8d18d9c 100644 --- a/src/common/folding.cc +++ b/src/common/folding.cc @@ -183,14 +183,14 @@ wstring trimWhitespaceOrPunct( wstring const & in ) wstring::size_type wordSize = in.size(); // Skip any leading whitespace - while ( *wordBegin && ( Folding::isWhitespace( *wordBegin ) || Folding::isPunct( *wordBegin ) ) ) { + while ( *wordBegin && Folding::isWhitespaceOrPunct( *wordBegin ) ) { ++wordBegin; --wordSize; } // Skip any trailing whitespace while ( wordSize - && ( Folding::isWhitespace( wordBegin[ wordSize - 1 ] ) || Folding::isPunct( wordBegin[ wordSize - 1 ] ) ) ) + && Folding::isWhitespaceOrPunct( wordBegin[ wordSize - 1 ] ) ) --wordSize; return wstring( wordBegin, wordSize );