File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ std::istream& StreamHandler::get_line(std::istream& stream, std::string& line) {
1313 std::getline (stream, newline);
1414
1515 // Windows CRLF (\r\n)
16- if (newline.size () && newline[newline.size () - 1 ] == ' \r ' ) {
16+ if (! newline.empty () && newline[newline.size () - 1 ] == ' \r ' ) {
1717 line = newline.substr (0 , newline.size () - 1 );
1818 // MacOS LF (\r)
19- } else if (newline.size () && newline[newline.size ()] == ' \r ' ) {
19+ } else if (! newline.empty () && newline[newline.size ()] == ' \r ' ) {
2020 line = newline.replace (newline.size (), 1 , " \n " );
2121 } else {
2222 line = newline;
@@ -74,7 +74,9 @@ std::string String::trim(const std::string& line) {
7474
7575double String::convert_to_double (const std::string& value, double default_value) {
7676 double converted_value = default_value;
77- fast_float::from_chars (value.data (), value.data () + value.size (), converted_value);
77+ auto begin = value.begin ();
78+ auto end = value.end ();
79+ fast_float::from_chars (&(*begin), &(*end), converted_value);
7880 return converted_value;
7981}
8082
You can’t perform that action at this time.
0 commit comments