mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
getOverlaps should use non-empty range filter
We can eliminate the need to parse the entire database if we only look for overlaps based on the latest interval. Related to issue #245.
This commit is contained in:
parent
9c0c27b55b
commit
3ec09f9be1
2 changed files with 3 additions and 1 deletions
|
@ -35,6 +35,7 @@ class Interval : public Range
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Interval () = default;
|
Interval () = default;
|
||||||
|
Interval (const Datetime& start, const Datetime& end) : Range (start, end) {}
|
||||||
bool empty () const;
|
bool empty () const;
|
||||||
|
|
||||||
bool hasTag (const std::string&) const;
|
bool hasTag (const std::string&) const;
|
||||||
|
|
|
@ -446,7 +446,8 @@ std::vector <Interval> getOverlaps (
|
||||||
const Rules& rules,
|
const Rules& rules,
|
||||||
const Interval& interval)
|
const Interval& interval)
|
||||||
{
|
{
|
||||||
Interval range_filter;
|
Interval range_filter {interval.start, interval.end};
|
||||||
|
|
||||||
auto tracked = getTracked (database, rules, range_filter);
|
auto tracked = getTracked (database, rules, range_filter);
|
||||||
|
|
||||||
std::vector <Interval> overlaps;
|
std::vector <Interval> overlaps;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue