Load returns the value stored in the map for the key, with an additional bool indicating if the key was found.
(key K)
| 64 | // Load returns the value stored in the map for the key, with an additional bool indicating if |
| 65 | // the key was found. |
| 66 | func (m *OrderedMap[K, V]) Load(key K) (V, bool) { |
| 67 | m.rehydrate() |
| 68 | |
| 69 | if p := m.inner[key]; p != nil { |
| 70 | return p.Value, true |
| 71 | } |
| 72 | var v V |
| 73 | return v, false |
| 74 | } |
| 75 | |
| 76 | // Store stores the value in the map for the key, overwriting the previous value if the key exists. |
| 77 | func (m *OrderedMap[K, V]) Store(key K, value V) { |