Skip to content

Commit 9c39584

Browse files
committed
Document substrings pitfalls.
1 parent 1fbeaf9 commit 9c39584

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/org/rascalmpl/library/String.rsc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,11 @@ str(str) indentTabsAsSpaces(int tabSize) {
742742
}
743743

744744
@synopsis{Compute all possible strict substrings of a string.}
745+
@pitfalls{
746+
* Does not include the empty string.
747+
* Does not include the input string itself.
748+
* The number of substrings is quadratic in the size of the string; expensive to compute.
749+
}
745750
set[str] substrings(str input)
746751
= {input[i..i+l] | int i <- [0..size(input)], int l <- [1..size(input)], i + l <= size(input)};
747752

0 commit comments

Comments
 (0)