mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
builtin: cleanup u8.repeat() and rune.repeat() (#22100)
This commit is contained in:
parent
e3ceb5881a
commit
971feb8f89
3 changed files with 7 additions and 18 deletions
|
@ -10,9 +10,7 @@ pub fn (ra []rune) string() string {
|
|||
}
|
||||
|
||||
pub fn (c rune) repeat(count int) string {
|
||||
if count < 0 {
|
||||
panic('rune.repeat: count is negative: ${count}')
|
||||
} else if count == 0 {
|
||||
if count <= 0 {
|
||||
return ''
|
||||
} else if count == 1 {
|
||||
return c.str()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue