Conversation
drbergman
left a comment
There was a problem hiding this comment.
If we're not creating cells (create_cells = false) should we skip all these checks and (possible) debug prints? As far as I can tell, if create_cells = false, there are no side effects among all these statements other than the debug prints.
| int idx_var = pCell->custom_data.find_vector_variable_index( pair.first ); | ||
| // if it exists, overwrite | ||
| if( idx_var > -1 ) | ||
| { | ||
| pCell->custom_data.vector_variables[idx_var].value[jj] = pair.second; | ||
| } | ||
| else | ||
| { | ||
| std::cout << __FUNCTION__ << " Error: got an invalid custom data vector name: " << pair.first << " . Exiting! " << std::endl; | ||
| std::exit(-1); | ||
| } |
There was a problem hiding this comment.
could lift the checks for this out of the for block over the vector entries.
There was a problem hiding this comment.
All I know is that my test for wanting to see debug prints, but not create cells, resulted in a segfault and these "fixes" avoided that. I'm OK with your logic so long as there are tests included to confirm it. I only discovered the segfault when I was wrapping the "resume" functionality for the Python API, which now works.
create_cellsanddebug_printflags