Actions
Feature #21459
openAdd Set C-API
Status:
Open
Assignee:
-
Target version:
-
Description
I would like to add a minimal C-API for Set:
void rb_set_foreach(VALUE set, int (*func)(VALUE element, VALUE arg), VALUE arg);
VALUE rb_set_new(void);
VALUE rb_set_new_capa(unsigned long capa);
bool rb_set_lookup(VALUE set, VALUE element);
bool rb_set_add(VALUE set, VALUE element);
VALUE rb_set_clear(VALUE set);
bool rb_set_delete(VALUE set, VALUE element);
size_t rb_set_size(VALUE set);
I think this should allow extension libraries to start benefiting from core Set without having to resort to method calls (dangerous in an C extension as they could be redefined to return objects of an unexpected type).
I've submitted a pull request for this: https://github.com/ruby/ruby/pull/13735
No data to display
Actions
Like0