mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Variant: Return const refs rather than string copies
This commit is contained in:
parent
fa7d4352cd
commit
8c0f46309b
2 changed files with 9 additions and 9 deletions
|
@ -166,7 +166,7 @@ void Variant::source (const std::string& input)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::string Variant::source () const
|
const std::string& Variant::source () const
|
||||||
{
|
{
|
||||||
return _source;
|
return _source;
|
||||||
}
|
}
|
||||||
|
@ -2174,7 +2174,7 @@ double Variant::get_real () const
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::string Variant::get_string () const
|
const std::string& Variant::get_string () const
|
||||||
{
|
{
|
||||||
return _string;
|
return _string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
~Variant ();
|
~Variant ();
|
||||||
|
|
||||||
void source (const std::string&);
|
void source (const std::string&);
|
||||||
std::string source () const;
|
const std::string& source () const;
|
||||||
|
|
||||||
Variant& operator= (const Variant&);
|
Variant& operator= (const Variant&);
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public:
|
||||||
bool get_bool () const;
|
bool get_bool () const;
|
||||||
int get_integer () const;
|
int get_integer () const;
|
||||||
double get_real () const;
|
double get_real () const;
|
||||||
std::string get_string () const;
|
const std::string& get_string () const;
|
||||||
time_t get_date () const;
|
time_t get_date () const;
|
||||||
time_t get_duration () const;
|
time_t get_duration () const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue