blob: b230ed1a6d223f025367ff127af8b112fd739e91 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
[RBTREE] Refactor `rb_*` APIs to Generic Naming for Future Flexibility
The current API set for range management is tightly coupled to the rbtree implementation, with function names prefixed as `rb_*`.
However, the underlying data structure may evolve in the future.
To decouple the interface from the specific data structure and improve long-term maintainability, I propose renaming the `rb_*` APIs to use a more generic `range_*` prefix.
The proposed `range_*` prefix does not imply a change in implementation — it is simply an abstraction layer over the current `rbtree`. This naming can remain stable even if the underlying structure changes.
## Proposed Renaming
| Current Name | Proposed Name |
|------------------------|------------------------|
| `rbtree_init` | `range_init` |
| `rbtree_delet` | `range_delete` |
| `rb_get` | `range_get` |
| `rb_get_64` | `range_get_64` |
| `rb_get_end` | `range_get_end` |
| `rb_get_end_64` | `range_get_end_64` |
| `rb_set` | `range_set` |
| `rb_set_64` | `range_set_64` |
| `rb_unset` | `range_unset` |
| `rb_inc` | `range_inc` |
| `rb_dec` | `range_dec` |
| `rb_get_rightmost` | `range_get_rightmost` |
| `rb_get_leftmost` | `range_get_leftmost` |
Feel free to close this if it's not needed — I can submit a PR for this refactor if you think it's worthwhile.
|