mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Removed unused util.cpp escape function.
This commit is contained in:
parent
66bb5b3906
commit
adee92a6b9
2 changed files with 0 additions and 23 deletions
21
src/util.cpp
21
src/util.cpp
|
@ -325,27 +325,6 @@ int execute (
|
|||
// Collides with std::numeric_limits methods
|
||||
#undef max
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Escapes any unescaped character of type c within the given string
|
||||
// e.g. ' ' -> '\ '
|
||||
const std::string escape (const std::string& value, char c)
|
||||
{
|
||||
std::string modified = value;
|
||||
char tmp[2] = {c, '\0'};
|
||||
std::string search = tmp;
|
||||
std::string replace = "\\" + search;
|
||||
|
||||
std::string::size_type pos = modified.find (search);
|
||||
while (pos != std::string::npos) {
|
||||
if ( modified[pos-1] != '\\' )
|
||||
modified.replace (pos, 1, replace);
|
||||
|
||||
pos = modified.find (search, pos+1);
|
||||
}
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Accept a list of projects, and return an indented list
|
||||
// that reflects the hierarchy.
|
||||
|
|
|
@ -61,8 +61,6 @@ int execute (const std::string&, const std::vector <std::string>&, const std::st
|
|||
int flock (int, int);
|
||||
#endif
|
||||
|
||||
const std::string escape (const std::string&, char);
|
||||
|
||||
const std::vector<std::string> indentTree (
|
||||
const std::vector<std::string>&,
|
||||
const std::string& whitespace = " ",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue