summaryrefslogtreecommitdiffstats
path: root/yql/essentials/public/udf/udf_ut_helpers.h
diff options
context:
space:
mode:
authorvvvv <[email protected]>2025-10-08 11:41:14 +0300
committervvvv <[email protected]>2025-10-08 12:20:42 +0300
commitd73f13cfdb331365ddad0da51ec36e0a3e4cf187 (patch)
tree88cab10170ce9aa3389be7f1a09247386dcf5ebd /yql/essentials/public/udf/udf_ut_helpers.h
parentf377d8ad9e0741cd904c1d4934afdf24af517d93 (diff)
YQL-20086 public
commit_hash:68b0c2e9c2960587af7d57ecedcb38f4d05890b7
Diffstat (limited to 'yql/essentials/public/udf/udf_ut_helpers.h')
-rw-r--r--yql/essentials/public/udf/udf_ut_helpers.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/yql/essentials/public/udf/udf_ut_helpers.h b/yql/essentials/public/udf/udf_ut_helpers.h
index af95e727dc3..fb56eae790c 100644
--- a/yql/essentials/public/udf/udf_ut_helpers.h
+++ b/yql/essentials/public/udf/udf_ut_helpers.h
@@ -12,11 +12,13 @@
namespace NYql {
namespace NUdf {
-template<bool HasLength = true>
+template <bool HasLength = true>
class TLazyList: public NUdf::TBoxedValue {
struct TIterator: public NUdf::TBoxedValue {
TIterator(i32 from, i32 to)
- : From_(from), To_(to), Curr_(Max<i32>())
+ : From_(from)
+ , To_(to)
+ , Curr_(Max<i32>())
{
if (To_ >= From_) {
To_--; // exclude last
@@ -24,6 +26,7 @@ class TLazyList: public NUdf::TBoxedValue {
From_--; // exclude first
}
}
+
private:
bool Skip() override {
if (Curr_ == Max<i32>()) {
@@ -45,16 +48,19 @@ class TLazyList: public NUdf::TBoxedValue {
}
bool Next(NUdf::TUnboxedValue& value) override {
- if (!Skip())
+ if (!Skip()) {
return false;
+ }
value = NUdf::TUnboxedValuePod(Curr_);
return true;
}
i32 From_, To_, Curr_;
};
+
public:
TLazyList(i32 from, i32 to)
- : From_(from), To_(to)
+ : From_(from)
+ , To_(to)
{
}
@@ -64,8 +70,9 @@ private:
}
ui64 GetListLength() const override {
- if (HasLength)
+ if (HasLength) {
return Abs(To_ - From_);
+ }
Y_ABORT("No length!");
}
@@ -109,5 +116,5 @@ private:
i32 From_, To_;
};
-}
-}
+} // namespace NUdf
+} // namespace NYql