changed basicShift and basicFill primitives not to validate source position and destination position when count is <= 0

This commit is contained in:
hyunghwan.chung
2018-01-04 10:07:42 +00:00
parent f0df2fcd92
commit 506c6900e0
3 changed files with 64 additions and 33 deletions

View File

@ -104,11 +104,17 @@ class(#pointer) Array(Collection)
}.
}
method copyFrom: start
{
| newsz |
newsz := (self size) - start.
^(self class new: newsz) copy: self from: start to: ((self size) - 1).
}
method copyFrom: start to: end
{
## returns a copy of the receiver starting from the element
## at index 'start' to the element at index 'end'.
| newsz |
newsz := end - start + 1.
^(self class new: newsz) copy: self from: start to: end