Remove unused parameter from FixedLengthEncodingParameters::ValidParameters

Bug: webrtc:370878648
Change-Id: I0031426ebc7ea9b95d7d322a6637c57cb6344ae9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364506
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43161}
This commit is contained in:
Dor Hen 2024-10-02 14:17:53 -07:00 committed by WebRTC LUCI CQ
parent 3e99f8c877
commit fe6ed1364b
3 changed files with 6 additions and 9 deletions

View File

@ -116,7 +116,6 @@ class FixedLengthEncodingParameters final {
public:
static bool ValidParameters(uint64_t delta_width_bits,
bool signed_deltas,
bool values_optional,
uint64_t value_width_bits) {
return (1 <= delta_width_bits && delta_width_bits <= 64 &&
1 <= value_width_bits && value_width_bits <= 64 &&
@ -133,8 +132,8 @@ class FixedLengthEncodingParameters final {
value_width_bits_(value_width_bits),
delta_mask_(MaxUnsignedValueOfBitWidth(delta_width_bits_)),
value_mask_(MaxUnsignedValueOfBitWidth(value_width_bits_)) {
RTC_DCHECK(ValidParameters(delta_width_bits, signed_deltas, values_optional,
value_width_bits));
RTC_DCHECK(
ValidParameters(delta_width_bits, signed_deltas, value_width_bits));
}
// Number of bits necessary to hold the widest(*) of the deltas between the
@ -701,7 +700,7 @@ std::unique_ptr<FixedLengthDeltaDecoder> FixedLengthDeltaDecoder::Create(
// for illegal values to be read. We check nevertheless, in case the code
// changes in the future in a way that breaks this promise.
if (!FixedLengthEncodingParameters::ValidParameters(
delta_width_bits, signed_deltas, values_optional, value_width_bits)) {
delta_width_bits, signed_deltas, value_width_bits)) {
RTC_LOG(LS_WARNING) << "Corrupt log; illegal encoding parameters.";
return nullptr;
}

View File

@ -91,8 +91,8 @@ FixedLengthEncodingParametersV3::CalculateParameters(
// equal".
RTC_DCHECK(!use_signed_deltas || delta_bit_width < 64);
RTC_DCHECK(ValidParameters(delta_bit_width, use_signed_deltas,
values_optional, value_bit_width));
RTC_DCHECK(
ValidParameters(delta_bit_width, use_signed_deltas, value_bit_width));
return FixedLengthEncodingParametersV3(delta_bit_width, use_signed_deltas,
values_optional, value_bit_width);
}
@ -122,8 +122,7 @@ FixedLengthEncodingParametersV3::ParseDeltaHeader(uint64_t header,
return std::nullopt;
}
if (!ValidParameters(delta_bit_width, signed_deltas, values_optional,
value_bit_width)) {
if (!ValidParameters(delta_bit_width, signed_deltas, value_bit_width)) {
RTC_LOG(LS_ERROR) << "Failed to parse delta header. Invalid combination of "
"values: delta_bit_width="
<< delta_bit_width << " signed_deltas=" << signed_deltas

View File

@ -25,7 +25,6 @@ class FixedLengthEncodingParametersV3 final {
public:
static bool ValidParameters(uint64_t delta_bit_width,
bool signed_deltas,
bool values_optional,
uint64_t value_bit_width) {
return (1 <= delta_bit_width && delta_bit_width <= 64 &&
1 <= value_bit_width && value_bit_width <= 64 &&