Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed...
[oota-llvm.git] / include / llvm / ADT / SparseBitVector.h
index 6c813ecd36b2449fba09a1c4c878e6e27b845598..0862981887ab186172854519cead93ba808be58e 100644 (file)
@@ -889,13 +889,17 @@ operator-(const SparseBitVector<ElementSize> &LHS,
 // Dump a SparseBitVector to a stream
 template <unsigned ElementSize>
 void dump(const SparseBitVector<ElementSize> &LHS, raw_ostream &out) {
-  out << "[ ";
-
-  typename SparseBitVector<ElementSize>::iterator bi;
-  for (bi = LHS.begin(); bi != LHS.end(); ++bi) {
-    out << *bi << " ";
+  out << "[";
+
+  typename SparseBitVector<ElementSize>::iterator bi = LHS.begin(),
+    be = LHS.end();
+  if (bi != be) {
+    out << *bi;
+    for (++bi; bi != be; ++bi) {
+      out << " " << *bi;
+    }
   }
-  out << " ]\n";
+  out << "]\n";
 }
 } // end namespace llvm