1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: combine simple attributes into a single line (#9120)

This commit is contained in:
Lukas Neubert
2021-03-05 06:17:57 +01:00
committed by GitHub
parent 208cabc994
commit 80356edd8c
6 changed files with 47 additions and 16 deletions

View File

@ -211,8 +211,7 @@ pub fn (mut a array) trim(index int) {
}
// we manually inline this for single operations for performance without -prod
[inline]
[unsafe]
[inline; unsafe]
fn (a array) get_unsafe(i int) voidptr {
unsafe {
return byteptr(a.data) + i * a.element_size
@ -398,8 +397,7 @@ fn (a &array) slice_clone(start int, _end int) array {
}
// we manually inline this for single operations for performance without -prod
[inline]
[unsafe]
[inline; unsafe]
fn (mut a array) set_unsafe(i int, val voidptr) {
unsafe { C.memcpy(byteptr(a.data) + a.element_size * i, val, a.element_size) }
}