PragmaTwice commented on code in PR #2300:
URL: https://github.com/apache/kvrocks/pull/2300#discussion_r1593773084
##########
src/search/interval.h:
##########
@@ -128,11 +128,32 @@ struct IntervalSet {
}
friend IntervalSet operator&(const IntervalSet &l, const IntervalSet &r) {
- if (l.IsEmpty() || r.IsEmpty()) {
- return IntervalSet();
+ IntervalSet result;
+
+ if (l.intervals.empty() || r.intervals.empty()) {
+ return result;
+ }
+
+ auto it_l = l.intervals.begin();
+ auto it_r = r.intervals.begin();
+
+ while (it_l != l.intervals.end() && it_r != r.intervals.end()) {
+ // Find overlap between current intervals
Review Comment:
We assume that there's no NaN in the input.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]