Skip to content

Commit 4fd013e

Browse files
remove unnecesarry capacity check within Str equals
1 parent fc0a9ec commit 4fd013e

File tree

1 file changed

+2
-3
lines changed
  • crates/compiler/builtins/bitcode/src

1 file changed

+2
-3
lines changed

crates/compiler/builtins/bitcode/src/str.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub const RocStr = extern struct {
179179

180180
pub fn eq(self: RocStr, other: RocStr) bool {
181181
// If they are byte-for-byte equal, they're definitely equal!
182-
if (self.bytes == other.bytes and self.length == other.length and self.capacity_or_alloc_ptr == other.capacity_or_alloc_ptr) {
182+
if (self.bytes == other.bytes and self.length == other.length) {
183183
return true;
184184
}
185185

@@ -2256,8 +2256,7 @@ test "withAsciiUppercased: seamless slice" {
22562256
}
22572257

22582258
pub fn strCaselessAsciiEquals(self: RocStr, other: RocStr) callconv(.C) bool {
2259-
// If they are byte-for-byte equal, they're definitely equal!
2260-
if (self.bytes == other.bytes and self.length == other.length and self.capacity_or_alloc_ptr == other.capacity_or_alloc_ptr) {
2259+
if (self.bytes == other.bytes and self.length == other.length) {
22612260
return true;
22622261
}
22632262

0 commit comments

Comments
 (0)