Skip to content
Snippets Groups Projects
Commit 7fbaf728 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Kirill Yukhin
Browse files

rope: fix rope name template

Rope is a library to define a custom rope data
structure with specified type of a stored value, and
some rope functions such as split, alloc.

It is possible to choose a unique name for a defined
rope structure. It was implemented as

    #define rope_api(x) rope_##rope_name##_##x
    #define rope rope_##rope_name

But with such rope_api definition it was always
expanded to `rope_rope_name_<x value>`. So rope_name
was basically a constant 'rope_name' regardless what
was defined under it.

The patch fixes it and makes name generation just like
bps_tree.h.

Additionally, the name template is changed a bit, now
it is

    <rope_name>_ + rope + _<method>

instead of

    <rope> + _<rope_name>_ + <method>

It just appeared to look better. For example, consider
rope name 'xrow_update' and method 'size':

    new: xrow_update_rope_size()
    old: rope_xrow_update_size()

The second name would be generated by the old template
and looks wrong. The new name not only looks better,
but also conforms with our code style.
parent ba58c433
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment