Parcourir la source

[master] Pass string instead of c-string in CSVFile class constructor.

This fixes a performance issue reported by cppcheck.
Marcin Siodelski il y a 11 ans
Parent
commit
dbd014d085
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/lib/util/csv_file.cc

+ 1 - 1
src/lib/util/csv_file.cc

@@ -29,7 +29,7 @@ CSVRow::CSVRow(const size_t cols, const char separator)
 CSVRow::CSVRow(const std::string& text, const char separator)
     : separator_(1, separator) {
     // Parsing is exception safe, so this will not throw.
-    parse(text.c_str());
+    parse(text);
 }
 
 void