mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-08 15:20:36 +02:00
Refactor getDOM to use a pointer for the optional context
It's possible to call getDOM without a contextual task. Previously, this was done by referencing a "dummy" task which necessitated a way to distinguish such dummy tasks. This switches to using a pointer and treating the NULL value as meaning there is no context. Note that this cannot use `std::optional<&Task>`, as optional does not support reference types.
This commit is contained in:
parent
3af5ceadc1
commit
2812a8c77a
11 changed files with 76 additions and 82 deletions
|
@ -64,9 +64,8 @@ int CmdGet::execute (std::string& output)
|
|||
{
|
||||
case Lexer::Type::dom:
|
||||
{
|
||||
Task t;
|
||||
Variant result;
|
||||
if (getDOM (arg.attribute ("raw"), t, result))
|
||||
if (getDOM (arg.attribute ("raw"), NULL, result))
|
||||
results.emplace_back (result);
|
||||
else
|
||||
results.emplace_back ("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue