Alexey Serbin has posted comments on this change. Change subject: KUDU-2055 [part 2]: Add util to construct sorted disjoint interval ......................................................................
Patch Set 1: (9 comments) http://gerrit.cloudera.org:8080/#/c/8041/1/src/kudu/util/sorted_disjoint_interval-test.cc File src/kudu/util/sorted_disjoint_interval-test.cc: PS1, Line 36: struct ClosedInterval { Should this be a class/structure template as well (with type for the left and right point)? PS1, Line 37: int left, int right If not using a class template for this ClosedInterval, consider making the parameters for this constructor and the left and right members of the same type. Line 46: int64_t left; // Inclusive nit: const? Line 47: int64_t right; // Inclusive int: const? PS1, Line 85: vector<ClosedInterval> expected; : expected.emplace_back(-23, 2); : expected.emplace_back(3, 7); nit: here and below consider replacing with something like const vector<ClosedInterval> expected = { {-23, 2}, {3, 7} }; Line 132: I don't see any coverage for single element intervals, like { {0, 0}, {0, 1}, {1, 1} } etc. Consider adding tests for that as well. http://gerrit.cloudera.org:8080/#/c/8041/1/src/kudu/util/sorted_disjoint_interval.h File src/kudu/util/sorted_disjoint_interval.h: PS1, Line 89: inline Maybe, just move it inside the class definition above? PS1, Line 98: !Traits::valid(*cur) Two questions here: 1. Is it necessary to check for the end of the container here? 2. Why not to move this under the for () cycle below? PS1, Line 106: cur++ ++cur might be better since it doesn't need to store the prev iterator value. -- To view, visit http://gerrit.cloudera.org:8080/8041 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61a813c047be4882f246eaf404598e7e18fcac87 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot Gerrit-HasComments: Yes