File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -213,8 +213,18 @@ public class Monitor.CPU : Object {
213213 dis = new DataInputStream (csv_file. read ());
214214 string flag_data;
215215 while ((flag_data = dis. read_line ()) != null ) {
216- var splitted = flag_data. split (" ," );
217- all_flags. set (splitted[0 ], splitted[1 ]. replace (" \r " , " " ));
216+
217+ int comma_position = flag_data. index_of_char (' ,' );
218+
219+ if (comma_position == - 1 ) break ; // quick exit if no commas are in the line
220+
221+ string key = flag_data. substring (0 , comma_position);
222+ string value = flag_data. substring (comma_position + 1 )
223+ .replace (" \" " , " " )
224+ .replace (" " , " " )
225+ .strip ();
226+
227+ all_flags. set (key, value . replace (" \r " , " " ));
218228 }
219229 debug (" Parsed file %s " , csv_file. get_path ());
220230
You can’t perform that action at this time.
0 commit comments