mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Fixed comments, compilation warnings. - Decomposed Context::initialize into several, single-purpose methods. - Replaced Context::initialize with Context::initialize2.
This commit is contained in:
parent
a20a4da412
commit
d892a0cbd2
10 changed files with 217 additions and 534 deletions
|
@ -45,29 +45,12 @@ Variant::Variant (const Variant& other)
|
|||
// Explicitly copy only the relevant type. This saves memory.
|
||||
switch (mType)
|
||||
{
|
||||
case v_boolean:
|
||||
mBool = other.mBool;
|
||||
break;
|
||||
|
||||
case v_integer:
|
||||
mInteger = other.mInteger;
|
||||
break;
|
||||
|
||||
case v_double:
|
||||
mDouble = other.mDouble;
|
||||
break;
|
||||
|
||||
case v_string:
|
||||
mString = other.mString;
|
||||
break;
|
||||
|
||||
case v_date:
|
||||
mDate = other.mDate;
|
||||
break;
|
||||
|
||||
case v_duration:
|
||||
mDuration = other.mDuration;
|
||||
break;
|
||||
case v_boolean: mBool = other.mBool; break;
|
||||
case v_integer: mInteger = other.mInteger; break;
|
||||
case v_double: mDouble = other.mDouble; break;
|
||||
case v_string: mString = other.mString; break;
|
||||
case v_date: mDate = other.mDate; break;
|
||||
case v_duration: mDuration = other.mDuration; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,7 +447,7 @@ Variant& Variant::operator< (const Variant& other)
|
|||
switch (mType)
|
||||
{
|
||||
case v_boolean:
|
||||
throw std::string ("Cannot perform relationally compare Boolean types");
|
||||
throw std::string ("Cannot perform relational compare Boolean types");
|
||||
break;
|
||||
|
||||
case v_integer:
|
||||
|
@ -501,7 +484,7 @@ Variant& Variant::operator> (const Variant& other)
|
|||
switch (mType)
|
||||
{
|
||||
case v_boolean:
|
||||
throw std::string ("Cannot perform relationally compare Boolean types");
|
||||
throw std::string ("Cannot perform relational compare Boolean types");
|
||||
break;
|
||||
|
||||
case v_integer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue