diff options
| author | Roy Frostig <[email protected]> | 2010-08-26 11:57:14 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-08-26 11:57:48 -0700 |
| commit | c3c5e6c77388f3f81449c668e6a97b064cf41852 (patch) | |
| tree | 6400455bc309e7eef62b8aafe3a7262b51be23b7 /src/lib | |
| parent | Add a "param handler" to demand_fn for use in automatic type parameter instan... (diff) | |
| download | rust-c3c5e6c77388f3f81449c668e6a97b064cf41852.tar.xz rust-c3c5e6c77388f3f81449c668e6a97b064cf41852.zip | |
Workaround issue #152 in _uint.next_power_of_two
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/_uint.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/_uint.rs b/src/lib/_uint.rs index f3a6f935..2c2629c9 100644 --- a/src/lib/_uint.rs +++ b/src/lib/_uint.rs @@ -28,7 +28,9 @@ fn next_power_of_two(uint n) -> uint { let uint shift = 1u; while (shift <= halfbits) { tmp |= tmp >> shift; - shift <<= 1u; + // FIXME (issue #152): This would be just a tad cuter if it were + // shift <<= 1u + shift = shift << 1u; } ret tmp + 1u; } |