Skip to content

Commit 45e6aae

Browse files
committed
minor: fast_pack no longer used
1 parent b077ef9 commit 45e6aae

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

ext/cbson/cbson.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -868,27 +868,6 @@ static VALUE method_deserialize(VALUE self, VALUE bson) {
868868
return elements_to_hash(buffer, remaining);
869869
}
870870

871-
872-
static VALUE fast_pack(VALUE self)
873-
{
874-
VALUE res;
875-
long i, len;
876-
char c;
877-
char *buf;
878-
879-
len = RARRAY_LEN(self);
880-
buf = malloc(len * sizeof(char));
881-
882-
for (i = 0; i < len; i++) {
883-
buf[i] = FIX2INT(rb_ary_entry(self, i));
884-
}
885-
886-
res = rb_str_new(buf, len);
887-
888-
return res;
889-
}
890-
891-
892871
static VALUE objectid_generate(VALUE self)
893872
{
894873
VALUE oid;
@@ -972,8 +951,6 @@ void Init_cbson() {
972951
rb_define_method(ObjectID, "generate", objectid_generate, 0);
973952
rb_define_method(ObjectId, "generate", objectid_generate, 0);
974953

975-
rb_define_method(rb_cArray, "fast_pack", fast_pack, 0);
976-
977954
if (gethostname(hostname, MAX_HOSTNAME_LENGTH) != 0) {
978955
rb_raise(rb_eRuntimeError, "failed to get hostname");
979956
}

0 commit comments

Comments
 (0)