Skip to content

Commit 7e33fd3

Browse files
committed
small refactor
1 parent be1d142 commit 7e33fd3

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,10 @@ void process_call_data_operations(Builder& builder,
179179
BB_ASSERT_EQ(op.access_type, 0);
180180
field_ct value = poly_to_field_ct(op.value, builder);
181181
field_ct index = poly_to_field_ct(op.index, builder);
182-
fr w_value = 0;
183-
if (has_valid_witness_assignments) {
184-
// If witness are assigned, we use the correct value for w
185-
w_value = index.get_value();
182+
value.assert_equal(calldata_array[index]);
183+
if (!has_valid_witness_assignments) {
184+
index.is_zero();
186185
}
187-
field_ct w = field_ct::from_witness(&builder, w_value);
188-
value.assert_equal(calldata_array[w]);
189-
w.assert_equal(index);
190186
}
191187
};
192188

barretenberg/cpp/src/barretenberg/stdlib/primitives/databus/databus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ field_t<Builder> databus<Builder>::bus_vector::operator[](const field_pt& index)
5353
if (index.is_constant()) {
5454
index_witness_idx = context->put_constant_variable(index.get_value());
5555
} else {
56-
index_witness_idx = index.normalize().get_witness_index();
56+
index_witness_idx = index.get_normalized_witness_index();
5757
}
5858

5959
// Read from the bus vector at the specified index. Creates a single read gate

0 commit comments

Comments
 (0)