Fix shift function.
This commit is contained in:
parent
fb8459d4de
commit
3cb3dc8e4f
@ -78,7 +78,7 @@ def_package!(crate:BasicArrayPackage:"Basic array utilities.", lib, {
|
|||||||
lib,
|
lib,
|
||||||
"shift",
|
"shift",
|
||||||
|list: &mut Array| {
|
|list: &mut Array| {
|
||||||
if !list.is_empty() {
|
if list.is_empty() {
|
||||||
().into()
|
().into()
|
||||||
} else {
|
} else {
|
||||||
list.remove(0)
|
list.remove(0)
|
||||||
@ -106,6 +106,8 @@ def_package!(crate:BasicArrayPackage:"Basic array utilities.", lib, {
|
|||||||
|list: &mut Array, len: INT| {
|
|list: &mut Array, len: INT| {
|
||||||
if len >= 0 {
|
if len >= 0 {
|
||||||
list.truncate(len as usize);
|
list.truncate(len as usize);
|
||||||
|
} else {
|
||||||
|
list.clear();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
map,
|
map,
|
||||||
|
Loading…
Reference in New Issue
Block a user