From b8eb23ceefdd60cf7b2adf9bddf370150861469a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 10 May 2016 20:42:08 -0400 Subject: [PATCH] CmdCancel: Simplified code --- src/commands/CmdCancel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands/CmdCancel.cpp b/src/commands/CmdCancel.cpp index 2f89e0bc..68e23189 100644 --- a/src/commands/CmdCancel.cpp +++ b/src/commands/CmdCancel.cpp @@ -35,10 +35,9 @@ int CmdCancel ( Rules& rules, Database& database) { - // If there is an open interval, cancel it. + // If there is an open interval, cancel it by deleting it.. auto latest = getLatestInterval (database); - if ( latest.range.started () && - ! latest.range.ended ()) + if (latest.range.open ()) { database.deleteInterval (latest); if (rules.getBoolean ("verbose"))