File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -170,24 +170,17 @@ exprt concretize_arrays_in_expression(
170
170
template <typename T>
171
171
void fill_in_vector (
172
172
std::vector<T> &concrete_array,
173
- std::set<std::size_t > &initialized)
173
+ const std::set<std::size_t > &initialized)
174
174
{
175
- // Pad the concretized values to the left to assign the uninitialized
176
- // values of result.
177
-
178
- int last_initialized=-1 ;
179
- for (const auto &j : initialized)
180
- {
181
- // Start concretizing from the left of `j` and pad from right to left until
182
- // an initialized index (or 0) is reached
183
- std::size_t i=j;
184
- INVARIANT (
185
- concrete_array.size ()>j,
186
- " set of initialized indices should not contain out of bound values" );
187
- while (i!=0 && i!=last_initialized)
188
- concrete_array[--i]=concrete_array[j];
189
- last_initialized=j;
190
- }
175
+ PRECONDITION (!initialized.empty ());
176
+ auto it=initialized.begin ();
177
+ PRECONDITION (*initialized.rbegin ()==concrete_array.size ()-1 );
178
+
179
+ for (std::size_t j=0 ; j<concrete_array.size (); j++)
180
+ if (*it==j)
181
+ ++it;
182
+ else
183
+ concrete_array[j]=concrete_array[*it];
191
184
}
192
185
193
186
// / Utility function for concretization of strings. Copies concretized values to
You can’t perform that action at this time.
0 commit comments