Slightly optimize Str.isEmpty

This commit is contained in:
Brian Carroll 2021-12-13 16:01:13 +00:00
parent bbf04b8752
commit 457041a314

View file

@ -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