Skip to content

Commit ee02ffb

Browse files
author
Dave Herman
committed
---
yaml --- r: 817 b: refs/heads/master c: ce32246 h: refs/heads/master i: 815: 7cc4543 v: v3
1 parent 04802a8 commit ee02ffb

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9a539a5dd18d3e8cf9dfab59f793d2e4df58464c
2+
refs/heads/master: ce3224652f22c5c81e81da3eb31de56683c9d8ec

trunk/src/comp/util/bits.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,9 @@ import std._vec;
99

1010
state type t = rec(vec[mutable uint] storage, uint nbits);
1111

12-
// FIXME: we should bind std.max_int
13-
fn is32bit() -> bool {
14-
let uint n = 0xffffffffu;
15-
ret (n + 1u) == 0u;
16-
}
17-
12+
// FIXME: this should be a constant once they work
1813
fn uint_bits() -> uint {
19-
if (is32bit()) {
20-
ret 31u;
21-
} else {
22-
ret 63u;
23-
}
14+
ret 32u + ((1u << 32u) >> 27u) - 1u;
2415
}
2516

2617
// FIXME: this should be state
@@ -36,8 +27,6 @@ fn create(uint nbits, bool init) -> t {
3627
nbits = nbits);
3728
}
3829

39-
40-
4130
// FIXME: this should be state
4231
fn process(fn(uint, uint) -> uint op, t v0, t v1) -> bool {
4332
auto len = _vec.len[mutable uint](v1.storage);

0 commit comments

Comments
 (0)