Skip to content

Commit bfe9fc1

Browse files
committed
chore: fix minor issue
1 parent 203aee3 commit bfe9fc1

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

src/iceberg/inheritable_metadata.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "iceberg/inheritable_metadata.h"
2121

22-
#include <cassert>
2322
#include <utility>
2423

2524
#include <iceberg/result.h>

src/iceberg/util/decimal.cc

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include <array>
2828
#include <bit>
29-
#include <cassert>
3029
#include <charconv>
3130
#include <climits>
3231
#include <cmath>
@@ -270,6 +269,19 @@ void AdjustIntegerStringWithScale(int32_t scale, std::string* str) {
270269
str->at(is_negative_offset + 1) = '.';
271270
}
272271

272+
bool RescaleWouldCauseDataLoss(const Decimal& value, int32_t delta_scale,
273+
const Decimal& multiplier, Decimal* result) {
274+
if (delta_scale < 0) {
275+
auto res = value.Divide(multiplier);
276+
ICEBERG_DCHECK(res, "Decimal::Divide failed");
277+
*result = res->first;
278+
return res->second != 0;
279+
}
280+
281+
*result = value * multiplier;
282+
return (value < 0) ? *result > value : *result < value;
283+
}
284+
273285
} // namespace
274286

275287
Decimal::Decimal(std::string_view str) {
@@ -463,23 +475,6 @@ Result<Decimal> Decimal::FromString(std::string_view str, int32_t* precision,
463475
return result;
464476
}
465477

466-
namespace {
467-
468-
static bool RescaleWouldCauseDataLoss(const Decimal& value, int32_t delta_scale,
469-
const Decimal& multiplier, Decimal* result) {
470-
if (delta_scale < 0) {
471-
auto res = value.Divide(multiplier);
472-
ICEBERG_DCHECK(res, "Decimal::Divide failed");
473-
*result = res->first;
474-
return res->second != 0;
475-
}
476-
477-
*result = value * multiplier;
478-
return (value < 0) ? *result > value : *result < value;
479-
}
480-
481-
} // namespace
482-
483478
Result<Decimal> Decimal::FromBigEndian(const uint8_t* bytes, int32_t length) {
484479
static constexpr int32_t kMinDecimalBytes = 1;
485480
static constexpr int32_t kMaxDecimalBytes = 16;

0 commit comments

Comments
 (0)