mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
builtin,ast: apply small performance improvements, suggested by hotspot
This commit is contained in:
parent
d8f971ffb5
commit
80242c8041
8 changed files with 74 additions and 16 deletions
|
@ -669,6 +669,14 @@ fn test_starts_with() {
|
|||
assert s.starts_with('Language') == false
|
||||
}
|
||||
|
||||
fn test_starts_with_capital() {
|
||||
assert 'A sentence'.starts_with_capital()
|
||||
assert 'A paragraph. It also does.'.starts_with_capital()
|
||||
assert ''.starts_with_capital() == false
|
||||
assert 'no'.starts_with_capital() == false
|
||||
assert ' No'.starts_with_capital() == false
|
||||
}
|
||||
|
||||
fn test_trim_prefix() {
|
||||
s := 'V Programming Language'
|
||||
assert s.trim_prefix('V ') == 'Programming Language'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue