Class: Array

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#fast_packObject



832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
# File 'ext/cbson/cbson.c', line 832

static VALUE fast_pack(VALUE self)
{
    VALUE res;
    long i;
    char c;

    res = rb_str_buf_new(0);

    for (i = 0; i < RARRAY_LEN(self); i++) {
        c = FIX2LONG(RARRAY_PTR(self)[i]);
        rb_str_buf_cat(res, &c, sizeof(char));
    }

    return res;
}