mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
zig style
This commit is contained in:
parent
fe5e4d33bc
commit
4f549b7889
1 changed files with 3 additions and 2 deletions
|
@ -108,7 +108,8 @@ const RocStr = extern struct {
|
||||||
var index: usize = 0;
|
var index: usize = 0;
|
||||||
|
|
||||||
// TODO rewrite this into a for loop
|
// TODO rewrite this into a for loop
|
||||||
while (index < self.len()) {
|
const length = self.len();
|
||||||
|
while (index < length) {
|
||||||
if (self_bytes[index] != other_bytes[index]) {
|
if (self_bytes[index] != other_bytes[index]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -220,7 +221,7 @@ const RocStr = extern struct {
|
||||||
|
|
||||||
// Str.numberOfBytes
|
// Str.numberOfBytes
|
||||||
|
|
||||||
pub fn strNumberOfBytes(string: RocStr) callconv(.C) u64 {
|
pub fn strNumberOfBytes(string: RocStr) callconv(.C) usize {
|
||||||
return string.len();
|
return string.len();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue