Use parens, not WSA in tests, add docs linebreaks, factor calls into a var.

This commit is contained in:
Norbert Hajagos 2025-01-20 10:50:29 +01:00
parent 65ec82aa2a
commit 06640edb63
No known key found for this signature in database
3 changed files with 21 additions and 9 deletions

View file

@ -371,11 +371,12 @@ pub const RocStr = extern struct {
}
fn refcount(self: RocStr) usize {
if ((self.getCapacity() == 0 and !self.isSeamlessSlice()) or self.isSmallStr()) {
const is_seamless_slice = self.isSeamlessSlice();
if ((self.getCapacity() == 0 and !is_seamless_slice) or self.isSmallStr()) {
return 1;
}
const data_ptr = if (self.isSeamlessSlice())
const data_ptr = if (is_seamless_slice)
self.getAllocationPtr()
else
self.bytes;