From 1a29e1b03e649afb32532efb0d4b3f85f8b7cd43 Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Tue, 25 Oct 2016 00:53:12 +0300 Subject: [PATCH] sequences-docs: fix wording --- core/sequences/sequences-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 20f400a4d7..906d7c2e75 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1735,7 +1735,7 @@ $nl { $list "If you are using mutable state, the choice has to be made one way or another because of semantics; mutating a slice will change the underlying sequence." { "Using a slice can improve algorithmic complexity. For example, if each iteration of a loop decomposes a sequence using " { $link first } " and " { $link rest } ", then the loop will run in quadratic time, relative to the length of the sequence. Using " { $link rest-slice } " changes the loop to run in linear time, since " { $link rest-slice } " does not copy any elements. Taking a slice of a slice will “collapse” the slice so to avoid the double indirection, so it is safe to use slices in recursive code." } - "Accessing elements from a concrete sequence (such as a string or an array) is often faster than accessing elements from a slice, because slice access entails additional indirection. However, in some cases, if the slice is immediately consumed by an iteration combinator, the compiler can eliminate the slice allocation and indirect altogether." + "Accessing elements from a concrete sequence (such as a string or an array) is often faster than accessing elements from a slice, because slice access entails additional indirection. However, in some cases, if the slice is immediately consumed by an iteration combinator, the compiler can eliminate the slice allocation and indirection altogether." "If the slice outlives the original sequence, the original sequence will still remain in memory, since the slice will reference it. This can increase memory consumption unnecessarily." } { $heading "Subsequence operations" } -- 2.34.1