Convert remaining call sites

This commit is contained in:
Jan Prudil 2020-10-17 14:50:26 +02:00
parent aadccc4206
commit 132813849c
2 changed files with 6 additions and 6 deletions

View File

@ -332,8 +332,8 @@ test "PackedIntArray" {
comptime var bits = 0;
inline while (bits <= max_bits) : (bits += 1) {
//alternate unsigned and signed
const even = bits % 2 == 0;
const I = std.meta.Int(even, bits);
const sign: std.meta.Signedness = if (bits % 2 == 0) .signed else .unsigned;
const I = std.meta.Int(sign, bits);
const PackedArray = PackedIntArray(I, int_count);
const expected_bytes = ((bits * int_count) + 7) / 8;
@ -384,8 +384,8 @@ test "PackedIntSlice" {
comptime var bits = 0;
inline while (bits <= max_bits) : (bits += 1) {
//alternate unsigned and signed
const even = bits % 2 == 0;
const I = std.meta.Int(even, bits);
const sign: std.meta.Signedness = if (bits % 2 == 0) .signed else .unsigned;
const I = std.meta.Int(sign, bits);
const P = PackedIntSlice(I);
var data = P.init(&buffer, int_count);

View File

@ -3,10 +3,10 @@ const expect = std.testing.expect;
fn ShardedTable(comptime Key: type, comptime mask_bit_count: comptime_int, comptime V: type) type {
const key_bits = @typeInfo(Key).Int.bits;
expect(Key == std.meta.Int(false, key_bits));
expect(Key == std.meta.Int(.unsigned, key_bits));
expect(key_bits >= mask_bit_count);
const shard_key_bits = mask_bit_count;
const ShardKey = std.meta.Int(false, mask_bit_count);
const ShardKey = std.meta.Int(.unsigned, mask_bit_count);
const shift_amount = key_bits - shard_key_bits;
return struct {
const Self = @This();