mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v: tag more low level functions with [direct_array_access]
This commit is contained in:
@@ -6,6 +6,7 @@ const (
|
||||
invalid_escapes = ['(', '{', '$', '`', '.']
|
||||
)
|
||||
|
||||
[direct_array_access]
|
||||
pub fn smart_quote(str string, raw bool) string {
|
||||
len := str.len
|
||||
if len == 0 {
|
||||
@@ -27,16 +28,12 @@ pub fn smart_quote(str string, raw bool) string {
|
||||
break
|
||||
}
|
||||
if pos + 1 < len {
|
||||
unsafe {
|
||||
next = str.str[pos + 1].ascii_str()
|
||||
}
|
||||
next = str[pos + 1].ascii_str()
|
||||
}
|
||||
mut current := str
|
||||
mut toadd := str
|
||||
if len > 1 {
|
||||
unsafe {
|
||||
current = str.str[pos].ascii_str()
|
||||
}
|
||||
current = str[pos].ascii_str()
|
||||
toadd = current
|
||||
}
|
||||
// double quote
|
||||
|
||||
Reference in New Issue
Block a user