fhash icon indicating copy to clipboard operation
fhash copied to clipboard

some cleunup

Open hennink opened this issue 3 years ago • 0 comments

Hi Junhao Li,

Thanks a lot for contributing this code! I can tell you it will be used to model traffic flow in the Netherlands.

I did find some places in which the code could be cleaned up a bit, and collected them in this branch. I hope it will be of use to you and others as well.

The main things it addresses:

  1. corrected intent statements (inout --> in)

  2. corrected .not. associated(this%node_ptr) .or. .not. allocated(this%node_ptr%kv) statement (Fortran is not guaranteed to evaluate from left to right)

  3. deleted redundant deallocate statements

  4. simplified node_get

  5. greatly simplified the clean procedures. Furthermore, memory is now freed automatically by destructors (aka finalizers), so the user does not need to call clean on the hash table.

  6. non_overridable procedures (also helps the compiler to know what exact method you're calling at compile time)

  7. Some more flags in the Makefile (maybe you don't want those)

hennink avatar Oct 01 '21 10:10 hennink