Skip to content

some cleunup#3

Open
hennink wants to merge 83 commits intojl2922:masterfrom
hennink:master
Open

some cleunup#3
hennink wants to merge 83 commits intojl2922:masterfrom
hennink:master

Conversation

@hennink
Copy link
Collaborator

@hennink hennink commented Oct 1, 2021

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 and others added 30 commits September 30, 2021 17:17
- Also quells gfortran
  "Warning: Impure function ‘n_collisions’ at (1) might not be evaluated [-Wfunction-elimination]"
- Makes 'clear' redundant; memory is deleted automatically
- users will need to define HASH_FUNC excplicitly if they want a
  user-specied hash function
Copy link
Contributor

@FObermaier FObermaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with these changes. @jl2922 could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments