mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Removed unused text.cpp isWordEnd function.
This commit is contained in:
parent
7890cf0ab7
commit
3f07173a03
3 changed files with 1 additions and 45 deletions
22
src/text.cpp
22
src/text.cpp
|
@ -569,28 +569,6 @@ bool noVerticalSpace (const std::string& input)
|
|||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Input: hello, world
|
||||
// Result for pos: ....y......y
|
||||
bool isWordEnd (const std::string& input, std::string::size_type pos)
|
||||
{
|
||||
// Short circuit: no input means no word end.
|
||||
if (input.length () == 0)
|
||||
return false;
|
||||
|
||||
// If pos is the last alphanumeric character of the string.
|
||||
if (pos == input.length () - 1 && ! Lexer::is_ws (input[pos]) && !isPunctuation (input[pos]))
|
||||
return true;
|
||||
|
||||
// If pos is not the last alphanumeric character, but there is a following
|
||||
// non-alphanumeric character.
|
||||
if (pos < input.length () - 1 && ! Lexer::is_ws (input[pos]) && !isPunctuation (input[pos])
|
||||
&& ( Lexer::is_ws (input[pos + 1]) || isPunctuation (input[pos + 1])))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Override of ispunct, that considers #, $ and @ not to be punctuation.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue