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

@ -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

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