(K key)
| 4222 | } |
| 4223 | |
| 4224 | Node<K, V> findNode(K key) { |
| 4225 | java.lang.Comparable<K> object = comparator == null ? toComparable((K) key) |
| 4226 | : null; |
| 4227 | K keyK = (K) key; |
| 4228 | Node<K, V> node = root; |
| 4229 | while (node != null) { |
| 4230 | K[] keys = node.keys; |
| 4231 | int left_idx = node.left_idx; |
| 4232 | int result = cmp(object, keyK, keys[left_idx]); |
| 4233 | if (result < 0) { |
| 4234 | node = node.left; |
| 4235 | } else if (result == 0) { |
| 4236 | return node; |
| 4237 | } else { |
| 4238 | int right_idx = node.right_idx; |
| 4239 | if (left_idx != right_idx) { |
| 4240 | result = cmp(object, keyK, keys[right_idx]); |
| 4241 | } |
| 4242 | if (result > 0) { |
| 4243 | node = node.right; |
| 4244 | } else { |
| 4245 | return node; |
| 4246 | } |
| 4247 | } |
| 4248 | } |
| 4249 | return null; |
| 4250 | } |
| 4251 | |
| 4252 | /// Returns the value of the mapping with the specified key. |
| 4253 | /// |
no test coverage detected