Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit c151fa1

Browse files
committed
drop superfluous parens around while loops
1 parent 72f8278 commit c151fa1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dora/stdlib/primitives.dora

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Int32 {
8383
@pub @internal fun countOneBits(): Int32 {
8484
var x = self;
8585
var c = 0i32;
86-
while (x != 0i32) {
86+
while x != 0i32 {
8787
c = c + 1i32;
8888
x = x.bitwiseAnd(x.wrappingSub(1i32));
8989
}
@@ -260,7 +260,7 @@ impl Int64 {
260260
@pub @internal fun countOneBits(): Int32 {
261261
var x = self;
262262
var c = 0i32;
263-
while (x != 0i64) {
263+
while x != 0i64 {
264264
c = c + 1i32;
265265
x = x.bitwiseAnd(x.wrappingSub(1i64));
266266
}
@@ -272,7 +272,7 @@ impl Int64 {
272272
}
273273
var t = 1i64.shiftLeft(Int64::bits() - 1i32);
274274
var r = 0i32;
275-
while (self.bitwiseAnd(t)) == 0i64 {
275+
while self.bitwiseAnd(t) == 0i64 {
276276
t = t.shiftRight(1i32);
277277
r = r + 1i32;
278278
}
@@ -285,7 +285,7 @@ impl Int64 {
285285
}
286286
var t = 1i64;
287287
var r = 0i32;
288-
while (self.bitwiseAnd(t)) == 0i64 {
288+
while self.bitwiseAnd(t) == 0i64 {
289289
t = t.shiftLeft(1i32);
290290
r = r + 1i32
291291
}

dora/stdlib/string.dora

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl String {
175175
let bits = bits.toInt64();
176176
let array = Array[UInt8]::zero(bits);
177177
var at = array.size() - 1;
178-
while (at >= 0) {
178+
while at >= 0 {
179179
array(bits - 1 - at) = (('0'.toInt64()) + (data.shiftRight(at.toInt32()) & 1)).toUInt8();
180180
at = at - 1;
181181
}

0 commit comments

Comments
 (0)