Skip to content

Commit bd0fb36

Browse files
authored
Add comments/notation to between in pkg/ddc/base/portallocator/port_allocator_test.go. (#6040)
Signed-off-by: GaoshengR <231220017@smail.nju.edu.cn>
1 parent b8eb891 commit bd0fb36

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/ddc/base/portallocator/port_allocator_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ func hasDuplicatedElement(ports []int) bool {
167167
return len(m) != len(ports)
168168
}
169169

170+
// between checks whether all elements in slice a fall within the half-open interval [min, max).
171+
// It returns false if any element is less than min or greater than or equal to max.
170172
func between(a []int, min int, max int) bool {
171173
for _, value := range a {
172174
if value < min || value >= max {

0 commit comments

Comments
 (0)