mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Slightly optimize Str.isEmpty
This commit is contained in:
parent
bbf04b8752
commit
457041a314
1 changed files with 1 additions and 1 deletions
|
@ -214,7 +214,7 @@ pub const RocStr = extern struct {
|
|||
}
|
||||
|
||||
pub fn isEmpty(self: RocStr) bool {
|
||||
return self.len() == 0;
|
||||
return (self.str_len << 1) == 0;
|
||||
}
|
||||
|
||||
// If a string happens to be null-terminated already, then we can pass its
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue