fhash
fhash copied to clipboard
some cleunup
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:
-
corrected
intent
statements (inout --> in) -
corrected
.not. associated(this%node_ptr) .or. .not. allocated(this%node_ptr%kv)
statement (Fortran is not guaranteed to evaluate from left to right) -
deleted redundant
deallocate
statements -
simplified
node_get
-
greatly simplified the
clean
procedures. Furthermore, memory is now freed automatically by destructors (aka finalizers), so the user does not need to callclean
on the hash table. -
non_overridable
procedures (also helps the compiler to know what exact method you're calling at compile time) -
Some more flags in the Makefile (maybe you don't want those)