mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: add map string generation
This commit is contained in:
@ -135,6 +135,16 @@ fn (d mut DenseArray) push(kv KeyValue) u32 {
|
||||
return push_index
|
||||
}
|
||||
|
||||
// Private function. Used to implement array[] operator
|
||||
fn (d DenseArray) get(i int) voidptr {
|
||||
$if !no_bounds_checking? {
|
||||
if i < 0 || i >= d.size {
|
||||
panic('DenseArray.get: index out of range (i == $i, d.len == $d.size)')
|
||||
}
|
||||
}
|
||||
return byteptr(d.data) + i * sizeof(KeyValue)
|
||||
}
|
||||
|
||||
// Move all zeros to the end of the array
|
||||
// and resize array
|
||||
fn (d mut DenseArray) zeros_to_end() {
|
||||
|
Reference in New Issue
Block a user