aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/value.zig b/src/value.zig
index 3d5636ee34..b0558487f9 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -1756,17 +1756,8 @@ pub const Value = extern union {
const info = ty.intInfo(target);
var buffer: Value.BigIntSpace = undefined;
- const operand_bigint = val.toBigInt(&buffer, target);
-
- var limbs_buffer: [4]std.math.big.Limb = undefined;
- var result_bigint = BigIntMutable{
- .limbs = &limbs_buffer,
- .positive = undefined,
- .len = undefined,
- };
- result_bigint.popCount(operand_bigint, info.bits);
-
- return result_bigint.toConst().to(u64) catch unreachable;
+ const int = val.toBigInt(&buffer, target);
+ return @intCast(u64, int.popCount(info.bits));
},
}
}