mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
CFS, Msg, ViewText: Code cleanup
This commit is contained in:
parent
a1dbb0c294
commit
5666feaab9
3 changed files with 3 additions and 6 deletions
|
@ -546,9 +546,7 @@ void File::write_raw (const std::string& line)
|
||||||
open ();
|
open ();
|
||||||
|
|
||||||
if (_fh)
|
if (_fh)
|
||||||
{
|
|
||||||
fputs (line.c_str (), _fh);
|
fputs (line.c_str (), _fh);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -75,7 +75,6 @@ std::string Msg::serialize () const
|
||||||
output += i.first + ": " + i.second + "\n";
|
output += i.first + ": " + i.second + "\n";
|
||||||
|
|
||||||
output += "\n" + _payload + "\n";
|
output += "\n" + _payload + "\n";
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,10 +95,10 @@ bool Msg::parse (const std::string& input)
|
||||||
{
|
{
|
||||||
auto delimiter = i.find (':');
|
auto delimiter = i.find (':');
|
||||||
if (delimiter == std::string::npos)
|
if (delimiter == std::string::npos)
|
||||||
throw std::string ("ERROR: Malformed message header '") + i + "'";
|
throw std::string ("ERROR: Malformed message header '") + i + "'";
|
||||||
|
|
||||||
_header[Lexer::trim (i.substr (0, delimiter))] = Lexer::trim (i.substr (delimiter + 1));
|
_header[Lexer::trim (i.substr (0, delimiter))] = Lexer::trim (i.substr (delimiter + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse payload.
|
// Parse payload.
|
||||||
_payload = input.substr (separator + 2);
|
_payload = input.substr (separator + 2);
|
||||||
|
|
|
@ -120,7 +120,7 @@ std::string ViewText::render ()
|
||||||
unsigned int ideal = 0;
|
unsigned int ideal = 0;
|
||||||
_columns[col]->measure (_data[row][col], min, ideal);
|
_columns[col]->measure (_data[row][col], min, ideal);
|
||||||
|
|
||||||
if (min > global_min) global_min = min;
|
if (min > global_min) global_min = min;
|
||||||
if (ideal > global_ideal) global_ideal = ideal;
|
if (ideal > global_ideal) global_ideal = ideal;
|
||||||
|
|
||||||
// If a fixed-width column was just measured, there is no point repeating
|
// If a fixed-width column was just measured, there is no point repeating
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue