Skip to content

Commit

Permalink
Allow same wording for non-inplace versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Jun 26, 2024
1 parent 7775b4a commit c33f5d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions ext/roaring/bitmap32.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ rb_roaring32_init(void)
rb_define_method(cRoaringBitmap32, "xor!", rb_roaring32_xor_inplace, 1);
rb_define_method(cRoaringBitmap32, "andnot!", rb_roaring32_andnot_inplace, 1);

rb_define_method(cRoaringBitmap32, "&", rb_roaring32_and, 1);
rb_define_method(cRoaringBitmap32, "|", rb_roaring32_or, 1);
rb_define_method(cRoaringBitmap32, "^", rb_roaring32_xor, 1);
rb_define_method(cRoaringBitmap32, "-", rb_roaring32_andnot, 1);
rb_define_method(cRoaringBitmap32, "and", rb_roaring32_and, 1);
rb_define_method(cRoaringBitmap32, "or", rb_roaring32_or, 1);
rb_define_method(cRoaringBitmap32, "xor", rb_roaring32_xor, 1);
rb_define_method(cRoaringBitmap32, "andnot", rb_roaring32_andnot, 1);

rb_define_method(cRoaringBitmap32, "==", rb_roaring32_eq, 1);
rb_define_method(cRoaringBitmap32, "<", rb_roaring32_lt, 1);
Expand Down
8 changes: 4 additions & 4 deletions ext/roaring/bitmap64.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ rb_roaring64_init(void)
rb_define_method(cRoaringBitmap64, "xor!", rb_roaring64_xor_inplace, 1);
rb_define_method(cRoaringBitmap64, "andnot!", rb_roaring64_andnot_inplace, 1);

rb_define_method(cRoaringBitmap64, "&", rb_roaring64_and, 1);
rb_define_method(cRoaringBitmap64, "|", rb_roaring64_or, 1);
rb_define_method(cRoaringBitmap64, "^", rb_roaring64_xor, 1);
rb_define_method(cRoaringBitmap64, "-", rb_roaring64_andnot, 1);
rb_define_method(cRoaringBitmap64, "and", rb_roaring64_and, 1);
rb_define_method(cRoaringBitmap64, "or", rb_roaring64_or, 1);
rb_define_method(cRoaringBitmap64, "xor", rb_roaring64_xor, 1);
rb_define_method(cRoaringBitmap64, "andnot", rb_roaring64_andnot, 1);

rb_define_method(cRoaringBitmap64, "==", rb_roaring64_eq, 1);
rb_define_method(cRoaringBitmap64, "<", rb_roaring64_lt, 1);
Expand Down
12 changes: 8 additions & 4 deletions lib/roaring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ def self.included(base)
base.alias_method :length, :cardinality
base.alias_method :count, :cardinality

base.alias_method :+, :|
base.alias_method :union, :|
base.alias_method :intersection, :&
base.alias_method :difference, :-
base.alias_method :&, :and
base.alias_method :|, :or
base.alias_method :^, :xor
base.alias_method :-, :andnot
base.alias_method :+, :or
base.alias_method :union, :or
base.alias_method :intersection, :and
base.alias_method :difference, :andnot

base.alias_method :delete, :remove
base.alias_method :delete?, :remove?
Expand Down

0 comments on commit c33f5d6

Please sign in to comment.