* To find a leaf_node: * Search to the tree location appropriate for the given key: * If a note entry with matching key, return the note entry, else return NULL. */
| 147 | * If a note entry with matching key, return the note entry, else return NULL. |
| 148 | */ |
| 149 | static struct leaf_node *note_tree_find(struct notes_tree *t, |
| 150 | struct int_node *tree, unsigned char n, |
| 151 | const unsigned char *key_sha1) |
| 152 | { |
| 153 | void **p = note_tree_search(t, &tree, &n, key_sha1); |
| 154 | if (GET_PTR_TYPE(*p) == PTR_TYPE_NOTE) { |
| 155 | struct leaf_node *l = (struct leaf_node *) CLR_PTR_TYPE(*p); |
| 156 | if (hasheq(key_sha1, l->key_oid.hash, the_repository->hash_algo)) |
| 157 | return l; |
| 158 | } |
| 159 | return NULL; |
| 160 | } |
| 161 | |
| 162 | /* |
| 163 | * How to consolidate an int_node: |
no test coverage detected