mirror of
https://github.com/vlang/v.git
synced 2025-09-14 15:02:33 +03:00
make function arguments immutable
This commit is contained in:
parent
74dbb1bce3
commit
0f0ed8d716
8 changed files with 42 additions and 33 deletions
|
@ -115,8 +115,8 @@ fn is_js_prim(typ string) bool {
|
|||
typ == 'i8' || typ == 'i16' || typ == 'i32' || typ == 'i64'
|
||||
}
|
||||
|
||||
fn (p mut Parser) decode_array(typ string) string {
|
||||
typ = typ.replace('array_', '')
|
||||
fn (p mut Parser) decode_array(_typ string) string {
|
||||
typ := _typ.replace('array_', '')
|
||||
t := p.table.find_type(typ)
|
||||
fn_name := js_dec_name(typ)
|
||||
// If we have `[]Profile`, have to register a Profile en(de)coder first
|
||||
|
@ -149,8 +149,8 @@ fn js_dec_name(typ string) string {
|
|||
return name
|
||||
}
|
||||
|
||||
fn (p &Parser) encode_array(typ string) string {
|
||||
typ = typ.replace('array_', '')
|
||||
fn (p &Parser) encode_array(_typ string) string {
|
||||
typ := _typ.replace('array_', '')
|
||||
fn_name := js_enc_name(typ)
|
||||
return '
|
||||
o = cJSON_CreateArray();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue