Skip to content

Commit 2cc8de7

Browse files
jnthntatumcopybara-github
authored andcommitted
Remove unused const step factory.
This overload is never used outside of tests after refactors. PiperOrigin-RevId: 833074996
1 parent 439003a commit 2cc8de7

File tree

4 files changed

+12
-319
lines changed

4 files changed

+12
-319
lines changed

eval/eval/BUILD

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,14 @@ cc_library(
176176

177177
cc_library(
178178
name = "const_value_step",
179-
srcs = [
180-
"const_value_step.cc",
181-
],
182179
hdrs = [
183180
"const_value_step.h",
184181
],
185182
deps = [
186183
":compiler_constant_step",
187184
":direct_expression_step",
188185
":evaluator_core",
189-
"//common:allocator",
190-
"//common:constant",
191186
"//common:value",
192-
"//internal:status_macros",
193-
"//runtime/internal:convert_constant",
194187
"@com_google_absl//absl/status:statusor",
195188
],
196189
)
@@ -610,36 +603,6 @@ cc_test(
610603
],
611604
)
612605

613-
cc_test(
614-
name = "const_value_step_test",
615-
size = "small",
616-
srcs = [
617-
"const_value_step_test.cc",
618-
],
619-
deps = [
620-
":cel_expression_flat_impl",
621-
":const_value_step",
622-
":evaluator_core",
623-
"//base:data",
624-
"//common:constant",
625-
"//common:expr",
626-
"//eval/internal:errors",
627-
"//eval/public:activation",
628-
"//eval/public:cel_value",
629-
"//eval/public/testing:matchers",
630-
"//internal:status_macros",
631-
"//internal:testing",
632-
"//runtime:runtime_options",
633-
"//runtime/internal:runtime_env",
634-
"//runtime/internal:runtime_env_testing",
635-
"@com_google_absl//absl/base:nullability",
636-
"@com_google_absl//absl/status",
637-
"@com_google_absl//absl/status:statusor",
638-
"@com_google_absl//absl/time",
639-
"@com_google_protobuf//:protobuf",
640-
],
641-
)
642-
643606
cc_test(
644607
name = "container_access_step_test",
645608
size = "small",

eval/eval/const_value_step.cc

Lines changed: 0 additions & 47 deletions
This file was deleted.

eval/eval/const_value_step.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,28 @@
33

44
#include <cstdint>
55
#include <memory>
6+
#include <utility>
67

78
#include "absl/status/statusor.h"
8-
#include "common/allocator.h"
9-
#include "common/constant.h"
109
#include "common/value.h"
10+
#include "eval/eval/compiler_constant_step.h"
1111
#include "eval/eval/direct_expression_step.h"
1212
#include "eval/eval/evaluator_core.h"
1313

1414
namespace google::api::expr::runtime {
1515

16-
std::unique_ptr<DirectExpressionStep> CreateConstValueDirectStep(
17-
cel::Value value, int64_t expr_id = -1);
18-
19-
// Factory method for Constant Value expression step.
20-
absl::StatusOr<std::unique_ptr<ExpressionStep>> CreateConstValueStep(
21-
cel::Value value, int64_t expr_id, bool comes_from_ast = true);
16+
// Factory method for Constant AST node expression recursive step.
17+
inline std::unique_ptr<DirectExpressionStep> CreateConstValueDirectStep(
18+
cel::Value value, int64_t id = -1) {
19+
return std::make_unique<DirectCompilerConstantStep>(std::move(value), id);
20+
}
2221

2322
// Factory method for Constant AST node expression step.
24-
// Copies the Constant Expr node to avoid lifecycle dependency on source
25-
// expression.
26-
absl::StatusOr<std::unique_ptr<ExpressionStep>> CreateConstValueStep(
27-
const cel::Constant&, int64_t expr_id, cel::Allocator<> allocator,
28-
bool comes_from_ast = true);
23+
inline absl::StatusOr<std::unique_ptr<ExpressionStep>> CreateConstValueStep(
24+
cel::Value value, int64_t expr_id, bool comes_from_ast = true) {
25+
return std::make_unique<CompilerConstantStep>(std::move(value), expr_id,
26+
comes_from_ast);
27+
}
2928

3029
} // namespace google::api::expr::runtime
3130

eval/eval/const_value_step_test.cc

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)