diff --git a/dokka/main/cpg-core/de.fraunhofer.aisec.cpg.graph.statements.expressions/-binary-operator/hash-code.html b/dokka/main/cpg-core/de.fraunhofer.aisec.cpg.graph.statements.expressions/-binary-operator/hash-code.html index 6a98767d21..576bbb54d7 100644 --- a/dokka/main/cpg-core/de.fraunhofer.aisec.cpg.graph.statements.expressions/-binary-operator/hash-code.html +++ b/dokka/main/cpg-core/de.fraunhofer.aisec.cpg.graph.statements.expressions/-binary-operator/hash-code.html @@ -64,7 +64,7 @@
Implementation of hash code. We are including the name and the location in this hash code as a compromise between including too few attributes and performance. Please note that this means, that two nodes that might be semantically equal, such as two record declarations with the same name but different location (e.g. because of header files) will be sorted into different hash keys.
That means, that you need to be careful, if you use a Node as a key in a hash map. You should make sure that the location is set before you add it to a hash map. This can be a little tricky, since normally the Handler class will set the location after it has "handled" the node. However, most NodeBuilder will have an optional parameter to set the location already when creating the node.
Implementation of hash code. We are including the name and the location in this hash code as a compromise between including too few attributes and performance. Please note that this means, that two nodes that might be semantically equal, such as two record declarations with the same name but different location (e.g. because of header files) will be sorted into different hash keys.
That means, that you need to be careful, if you use a Node as a key in a hash map. You should make sure that the location is set before you add it to a hash map. This can be a little tricky, since normally the Handler class will set the location after it has "handled" the node. However, most NodeBuilder will have an optional parameter to set the location already when creating the node.