@@ -166,7 +166,7 @@ literalt cnft::land(const bvt &bv)
166166 if (bv.size ()==2 )
167167 return land (bv[0 ], bv[1 ]);
168168
169- for (const auto l : bv)
169+ for (const auto & l : bv)
170170 if (l.is_false ())
171171 return l;
172172
@@ -179,7 +179,7 @@ literalt cnft::land(const bvt &bv)
179179 literalt literal=new_variable ();
180180 lits[1 ]=neg (literal);
181181
182- for (const auto l : new_bv)
182+ for (const auto & l : new_bv)
183183 {
184184 lits[0 ]=pos (l);
185185 lcnf (lits);
@@ -188,7 +188,7 @@ literalt cnft::land(const bvt &bv)
188188 lits.clear ();
189189 lits.reserve (new_bv.size ()+1 );
190190
191- for (const auto l : new_bv)
191+ for (const auto & l : new_bv)
192192 lits.push_back (neg (l));
193193
194194 lits.push_back (pos (literal));
@@ -209,7 +209,7 @@ literalt cnft::lor(const bvt &bv)
209209 if (bv.size ()==2 )
210210 return lor (bv[0 ], bv[1 ]);
211211
212- for (const auto l : bv)
212+ for (const auto & l : bv)
213213 if (l.is_true ())
214214 return l;
215215
@@ -222,7 +222,7 @@ literalt cnft::lor(const bvt &bv)
222222 literalt literal=new_variable ();
223223 lits[1 ]=pos (literal);
224224
225- for (const auto l : new_bv)
225+ for (const auto & l : new_bv)
226226 {
227227 lits[0 ]=neg (l);
228228 lcnf (lits);
@@ -231,7 +231,7 @@ literalt cnft::lor(const bvt &bv)
231231 lits.clear ();
232232 lits.reserve (new_bv.size ()+1 );
233233
234- for (const auto l : new_bv)
234+ for (const auto & l : new_bv)
235235 lits.push_back (pos (l));
236236
237237 lits.push_back (neg (literal));
@@ -254,7 +254,7 @@ literalt cnft::lxor(const bvt &bv)
254254
255255 literalt literal=const_literal (false );
256256
257- for (const auto l : bv)
257+ for (const auto & l : bv)
258258 literal=lxor (l, literal);
259259
260260 return literal;
@@ -404,7 +404,7 @@ bvt cnft::eliminate_duplicates(const bvt &bv)
404404 bvt dest;
405405 dest.reserve (bv.size ());
406406
407- for (const auto l : bv)
407+ for (const auto & l : bv)
408408 if (s.insert (l).second )
409409 dest.push_back (l);
410410
@@ -423,7 +423,7 @@ bool cnft::process_clause(const bvt &bv, bvt &dest)
423423
424424 // first check simple things
425425
426- for (const auto l : bv)
426+ for (const auto & l : bv)
427427 {
428428 // we never use index 0
429429 INVARIANT (l.var_no () != 0 , " variable 0 must not be used" );
@@ -449,7 +449,7 @@ bool cnft::process_clause(const bvt &bv, bvt &dest)
449449 dest.clear ();
450450 dest.reserve (bv.size ());
451451
452- for (const auto l : bv)
452+ for (const auto & l : bv)
453453 {
454454 if (l.is_false ())
455455 continue ; // remove
0 commit comments