Skip to content

Commit 3dc4987

Browse files
authored
Merge pull request #562 from AztecProtocol/cb/bb-deadcode-cleanup
chore(bb): remove dead code in barretenberg C++ (unused files, helpers, flavor constants)
2 parents 2ceea66 + 18064e6 commit 3dc4987

10 files changed

Lines changed: 0 additions & 148 deletions

File tree

barretenberg/cpp/src/barretenberg/common/map.hpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Cont<OutElem> map(Cont<InElem, Args...> const& in, F&& op)
2121

2222
/*
2323
* Generic map function for mapping a std::array's elements to another type.
24-
* TODO: this has only been added because I (Mike) couldn't get the above to work
25-
* with an array.
2624
*/
2725
template <std::size_t SIZE,
2826
typename InElem,
@@ -34,32 +32,4 @@ std::array<OutElem, SIZE> map(std::array<InElem, SIZE> const& in, F&& op)
3432
std::transform(in.begin(), in.end(), result.begin(), op);
3533
return result;
3634
}
37-
38-
/*
39-
* Generic map function for mapping a containers element to another type.
40-
* This version passes the element index as a second argument to the operator function.
41-
*/
42-
template <template <typename, typename...> typename Cont,
43-
typename InElem,
44-
typename... Args,
45-
typename F,
46-
typename OutElem = typename std::invoke_result<F, InElem const&, size_t>::type>
47-
Cont<OutElem> mapi(Cont<InElem, Args...> const& in, F op)
48-
{
49-
Cont<OutElem> result;
50-
for (size_t i = 0; i < in.size(); ++i) {
51-
result.push_back(op(in[i], i));
52-
}
53-
return result;
54-
}
55-
56-
/*
57-
* Generic filter function for containers.
58-
*/
59-
template <typename Cont, typename F> Cont filter(Cont const& in, F op)
60-
{
61-
Cont copy(in);
62-
std::remove_if(copy.begin(), copy.end(), op);
63-
return copy;
64-
}
6535
} // namespace bb::transform

barretenberg/cpp/src/barretenberg/common/printf.hpp

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

barretenberg/cpp/src/barretenberg/flavor/mega_avm_flavor.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ class MegaAvmFlavor : public MegaAVMFlavor_Generated {
5555
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 1;
5656
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>;
5757

58-
static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
59-
static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
60-
6158
static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
6259
using SubrelationSeparator = FF;
6360

barretenberg/cpp/src/barretenberg/flavor/mega_flavor.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ class MegaFlavor : public MegaFlavor_Generated {
6060
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 1;
6161
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>;
6262

63-
static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
64-
static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
65-
6663
// A challenge whose powers are used to batch subrelation contributions during Sumcheck
6764
static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
6865
using SubrelationSeparator = FF;

barretenberg/cpp/src/barretenberg/flavor/mega_zk_flavor.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ class MegaZKFlavor : public MegaZKFlavor_Generated {
7676
"LIBRA_UNIVARIATES_LENGTH must be equal to MegaZKFlavor::BATCHED_RELATION_PARTIAL_LENGTH");
7777
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>;
7878

79-
static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
80-
static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
81-
8279
// A challenge whose powers are used to batch subrelation contributions during Sumcheck
8380
static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
8481
using SubrelationSeparator = FF;

barretenberg/cpp/src/barretenberg/flavor/ultra_flavor.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ class UltraFlavor : public UltraFlavor_Generated {
7171
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 1;
7272
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>;
7373

74-
static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
75-
static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
76-
7774
// HasZK_-parameterized AllEntities — switches between the non-ZK and ZK generated
7875
// AllEntities so UltraFlavorWithZK can reuse this surface (UltraZK only adds a masking column,
7976
// not any new entity *shapes*). The base-class `AllEntities<DataType>` from

barretenberg/cpp/src/barretenberg/honk/utils/testing.cpp

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

barretenberg/cpp/src/barretenberg/honk/utils/testing.hpp

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

barretenberg/cpp/src/barretenberg/numeric/bitop/keep_n_lsb.hpp

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

barretenberg/cpp/src/barretenberg/serialize/raw_pointer.hpp

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

0 commit comments

Comments
 (0)