Skip to content

Commit

Permalink
some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov committed Nov 2, 2023
1 parent 962fa2b commit ff313c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions vlib/builtin/js/array_test.js.v
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,24 @@ fn test_deleting() {

fn test_slice_delete() {
mut a := [1.5, 2.5, 3.25, 4.5, 5.75]
b := a[2..4]
b := a[2..4].clone()
a.delete(0)
assert a == [2.5, 3.25, 4.5, 5.75]
assert b == [3.25, 4.5]
a = [3.75, 4.25, -1.5, 2.25, 6.0]
c := a[..3]
c := a[..3].clone()
a.delete(2)
assert a == [3.75, 4.25, 2.25, 6.0]
assert c == [3.75, 4.25, -1.5]
}

fn test_delete_many() {
mut a := [1, 2, 3, 4, 5, 6, 7, 8, 9]
b := a[2..6]
b := a[2..6].clone()
a.delete_many(4, 3)
assert a == [1, 2, 3, 4, 8, 9]
assert b == [3, 4, 5, 6]
c := a[..a.len]
c := a[..a.len].clone()
a.delete_many(2, 0) // this should just clone
a[1] = 17
assert a == [1, 17, 3, 4, 8, 9]
Expand Down
2 changes: 1 addition & 1 deletion vlib/strings/strings.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module strings
// random returns a random string with `n` characters
/*
pub fn random(n int) string {
buf := vmalloc(n)
buf := v_malloc(n)
for i in 0..n {
buf[i] = rand.next()
}
Expand Down
6 changes: 3 additions & 3 deletions vlib/v/checker/tests/modules/module_with_redeclaration.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vlib/v/checker/tests/modules/module_with_redeclaration/redeclare_time_structs.v:1:1: error: project must include a `main` module or be a shared library (compile with `v -shared`)
vlib/v/checker/tests/modules/module_with_redeclaration/redeclare_time_structs.c.v:1:1: error: project must include a `main` module or be a shared library (compile with `v -shared`)
1 | module module_with_redeclaration
| ^
2 |
3 | import sokol.memory
2 |
3 | import sokol.memory
2 changes: 1 addition & 1 deletion vlib/v/tests/generics_with_pointer_index_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mut:
}

pub fn with_cap[T](cap int) Vec[T] {
new_data := unsafe { vmalloc(cap * int(sizeof(T))) }
new_data := unsafe { v_malloc(cap * int(sizeof(T))) }
unsafe { vmemset(new_data, 0, cap * int(sizeof(T))) }

return Vec[T]{
Expand Down

0 comments on commit ff313c2

Please sign in to comment.