Code Cleanup
- Removed unused function and corresponding unit tests. YAGNI.
This commit is contained in:
25
src/text.cpp
25
src/text.cpp
@@ -68,6 +68,7 @@ void wrapText (
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// UTF-8
|
||||
void splitq (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
@@ -86,9 +87,7 @@ void splitq (
|
||||
if (in_quote)
|
||||
{
|
||||
if (input[i] == quote)
|
||||
{
|
||||
in_quote = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,28 +168,6 @@ void split (
|
||||
results.push_back (input.substr (start));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void split_minimal (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
const std::string& delimiter)
|
||||
{
|
||||
results.clear ();
|
||||
std::string::size_type length = delimiter.length ();
|
||||
|
||||
std::string::size_type start = 0;
|
||||
std::string::size_type i;
|
||||
while ((i = input.find (delimiter, start)) != std::string::npos)
|
||||
{
|
||||
if (i != start)
|
||||
results.push_back (input.substr (start, i - start));
|
||||
start = i + length;
|
||||
}
|
||||
|
||||
if (input.length ())
|
||||
results.push_back (input.substr (start));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void join (
|
||||
std::string& result,
|
||||
|
||||
Reference in New Issue
Block a user