mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
builtin: cleanup obsolete function in string.v and array.v (#19451)
This commit is contained in:
parent
981f76cd04
commit
ec30256c7f
3 changed files with 1 additions and 15 deletions
|
@ -530,7 +530,7 @@ pub fn (mut a array) delete_last() {
|
|||
// Alternative: Slices can also be made with [start..end] notation
|
||||
// Alternative: `.slice_ni()` will always return an array.
|
||||
fn (a array) slice(start int, _end int) array {
|
||||
mut end := if _end == 2147483647 { a.len } else { _end } // max_int
|
||||
end := if _end == 2147483647 { a.len } else { _end } // max_int
|
||||
$if !no_bounds_checking {
|
||||
if start > end {
|
||||
panic('array.slice: invalid slice index (${start} > ${end})')
|
||||
|
@ -609,12 +609,6 @@ fn (a array) slice_ni(_start int, _end int) array {
|
|||
return res
|
||||
}
|
||||
|
||||
// used internally for [2..4]
|
||||
fn (a array) slice2(start int, _end int, end_max bool) array {
|
||||
end := if end_max { a.len } else { _end }
|
||||
return a.slice(start, end)
|
||||
}
|
||||
|
||||
// clone_static_to_depth() returns an independent copy of a given array.
|
||||
// Unlike `clone_to_depth()` it has a value receiver and is used internally
|
||||
// for slice-clone expressions like `a[2..4].clone()` and in -autofree generated code.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue