File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: d85447c4fb430e26fee5c3f85997aba1448c29ba
2
+ refs/heads/master: d4da3f51728f38030f41cfa320c80e3ffec6e795
Original file line number Diff line number Diff line change @@ -32,28 +32,28 @@ iter range(int lo, int hi) -> int {
32
32
fn to_str ( int n, uint radix ) -> str
33
33
{
34
34
assert ( 0 u < radix && radix <= 16 u) ;
35
- if ( n < 0 ) {
36
- ret "-" + uint::to_str((-n) as uint, radix);
35
+ ret if ( n < 0 ) {
36
+ "-" + uint:: to_str ( ( -n) as uint , radix)
37
37
} else {
38
- ret uint::to_str(n as uint, radix);
39
- }
38
+ uint:: to_str ( n as uint , radix)
39
+ } ;
40
40
}
41
41
42
42
fn pow ( int base , uint exponent ) -> int {
43
43
44
- if (exponent == 0u) {
45
- ret 1;
44
+ ret if ( exponent == 0 u) {
45
+ 1
46
46
} else if ( base == 0 ) {
47
- ret 0;
47
+ 0
48
48
} else {
49
49
auto accum = base;
50
50
auto count = exponent;
51
51
while ( count > 1 u) {
52
52
accum *= base;
53
53
count -= 1 u;
54
54
}
55
- ret accum;
56
- }
55
+ accum
56
+ } ;
57
57
}
58
58
59
59
// Local Variables:
You can’t perform that action at this time.
0 commit comments