val &= ((1U << bit_width) - 1);
}
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
for (unsigned i = 0; i < num; ++i) {
- out[i] = val + prev_out[i] + 1;
+ out[i] = prev_val = val + prev_val + 1;
}
return in + div_round_up(bit_width, 8);
}
{
const unsigned bit_width = *in++ & 0x3f;
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
BitReader bs(in, bit_width);
for (unsigned i = 0; i < num; ++i) {
- out[i] = bs.read() + prev_out[i] + 1;
+ prev_val = out[i] = bs.read() + prev_val + 1;
}
return in + bytes_for_packed_bits(num, bit_width);
}
out[i * 4 + 2] = bs2.read();
out[i * 4 + 3] = bs3.read();
}
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
for (unsigned i = 0; i < BlockSize; ++i) {
- out[i] += prev_out[i] + 1;
+ out[i] = prev_val = out[i] + prev_val + 1;
}
return in + bytes_for_packed_bits(BlockSize, bit_width);
}
}
// Decode the base values, and delta-decode.
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
BitReader bs(in, bit_width);
for (unsigned i = 0; i < num; ++i) {
- out[i] = (out[i] | bs.read()) + prev_out[i] + 1;
+ out[i] = prev_val = (out[i] | bs.read()) + prev_val + 1;
}
return in + bytes_for_packed_bits(num, bit_width);
}
out[i * 4 + 2] |= bs2.read();
out[i * 4 + 3] |= bs3.read();
}
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
for (unsigned i = 0; i < BlockSize; ++i) {
- out[i] += prev_out[i] + 1;
+ out[i] = prev_val = out[i] + prev_val + 1;
}
return in + bytes_for_packed_bits(BlockSize, bit_width);
}
}
// Delta-decode.
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
for (unsigned i = 0; i < num; ++i) {
- out[i] = out[i] + prev_out[i] + 1;
+ out[i] = prev_val = out[i] + prev_val + 1;
}
return in;
}
// Delta-decode.
- Docid *prev_out = out - 1;
+ Docid prev_val = out[-1];
for (unsigned i = 0; i < BlockSize; ++i) {
- out[i] = out[i] + prev_out[i] + 1;
+ out[i] = prev_val = out[i] + prev_val + 1;
}
return in;