Skip to content

Commit b1a0adb

Browse files
authored
Fix typo in views.md
1 parent 23c4df5 commit b1a0adb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_overviews/collections/views.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ One detail to note is that the static type of the final result is a Seq, not a V
7373
There are two reasons why you might want to consider using views. The first is performance. You have seen that by switching a collection to a view the construction of intermediate results can be avoided. These savings can be quite important. As another example, consider the problem of finding the first palindrome in a list of words. A palindrome is a word which reads backwards the same as forwards. Here are the necessary definitions:
7474

7575
def isPalindrome(x: String) = x == x.reverse
76-
def findPalidrome(s: Seq[String]) = s find isPalindrome
76+
def findPalindrome(s: Seq[String]) = s find isPalindrome
7777

78-
Now, assume you have a very long sequence words and you want to find a palindrome in the first million words of that sequence. Can you re-use the definition of `findPalidrome`? Of course, you could write:
78+
Now, assume you have a very long sequence words and you want to find a palindrome in the first million words of that sequence. Can you re-use the definition of `findPalindrome`? Of course, you could write:
7979

8080
findPalindrome(words take 1000000)
8181

0 commit comments

Comments
 (0)