File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -296,15 +296,17 @@ Cell DataFrameProcessor::parse_csv_cell(const std::string& value) {
296296 return Cell (); // Empty cell
297297 }
298298
299- // Try to parse as number
300- try {
301- size_t pos;
302- int num = std::stoi (trimmed, &pos);
303- if (pos == trimmed. length ()) {
304- return Cell (num) ;
299+ // Check if all characters are digits
300+ bool is_integer = true ;
301+ for ( char c : trimmed) {
302+ if (! std::isdigit ( static_cast < unsigned char >(c))) {
303+ is_integer = false ;
304+ break ;
305305 }
306- } catch (...) {
307- // Not a number, treat as string
306+ }
307+
308+ if (is_integer) {
309+ return Cell (std::stoi (trimmed));
308310 }
309311
310312 return Cell (trimmed);
You can’t perform that action at this time.
0 commit comments