Specify when the range is empty in KDoc

This commit is contained in:
Anastasiya Shadrina
2021-03-19 12:01:13 +07:00
committed by Anastasia Shadrina
parent 60f2f85be7
commit 94c4d1c23e
8 changed files with 79 additions and 7 deletions
+6 -1
View File
@@ -82,7 +82,12 @@ public open class $progression
override fun iterator(): ${t}Iterator = ${t}ProgressionIterator(first, last, step)
/** Checks if the progression is empty. */
/**
* Checks if the progression is empty.
* Progression with a positive step is empty if its first element is greater than the last element.
* Progression with a negative step is empty if its first element is less than the last element.
*/
public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last
override fun equals(other: Any?): Boolean =