Commit d13ff16
refactor: extract collection guard pattern into helper method
Extract repeated collection validation logic into a private helper method
_get_collection_or_raise() to reduce code duplication in MemoryStore.
- Created _get_collection_or_raise() helper with proper docstring
- Refactored 4 methods to use the helper:
- _get_managed_entry
- _put_managed_entry
- _delete_managed_entry
- _get_collection_keys
- Reduces 20 lines of duplicated code
- Maintains identical behavior and error messages
Addresses CodeRabbit review feedback.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: William Easton <[email protected]>1 parent 419dc68 commit d13ff16
File tree
1 file changed
+19
-21
lines changed- key-value/key-value-aio/src/key_value/aio/stores/memory
1 file changed
+19
-21
lines changedLines changed: 19 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
159 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| 172 | + | |
163 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
| |||
0 commit comments