Small refactoring

- use const and reference in fromJson
- reformat code
This commit is contained in:
Thomas Lauf 2018-10-05 18:31:35 +02:00
parent b64f6f7568
commit 59f44e7ff2
2 changed files with 5 additions and 6 deletions

View file

@ -32,7 +32,7 @@
////////////////////////////////////////////////////////////////////////////////
// Syntax:
// 'inc' [ <iso> [ '-' <iso> ]] [ '#' <tag> [ <tag> ... ]]
Interval IntervalFactory::fromSerialization (const std::string &line)
Interval IntervalFactory::fromSerialization (const std::string& line)
{
Lexer lexer (line);
std::vector <std::string> tokens;
@ -45,8 +45,7 @@ Interval IntervalFactory::fromSerialization (const std::string &line)
}
// Minimal requirement 'inc'.
if (!tokens.empty () &&
tokens[0] == "inc")
if (!tokens.empty () && tokens[0] == "inc")
{
Interval interval = Interval ();
@ -85,7 +84,7 @@ Interval IntervalFactory::fromSerialization (const std::string &line)
}
////////////////////////////////////////////////////////////////////////////////
Interval IntervalFactory::fromJson (std::string jsonString)
Interval IntervalFactory::fromJson (const std::string& jsonString)
{
Interval interval = Interval ();

View file

@ -33,8 +33,8 @@
class IntervalFactory
{
public:
static Interval fromSerialization (const std::string &line);
static Interval fromJson (std::string jsonString);
static Interval fromSerialization (const std::string& line);
static Interval fromJson (const std::string& jsonString);
};
#endif