projects
/
ruby-vorbistagger.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Delete the temporary file when we're done with it.
[ruby-vorbistagger.git]
/
ext
/
comments.c
diff --git
a/ext/comments.c
b/ext/comments.c
index bc7d844d0d10cf9829f7dd99f3fab4a4ac9912b2..a8236a51af5e514873d1ee0c318414ac5f74cdf1 100644
(file)
--- a/
ext/comments.c
+++ b/
ext/comments.c
@@
-64,8
+64,6
@@
comments_init (VALUE self, vcedit_state *state)
rb_ary_store (o->items, i, pair);
}
rb_ary_store (o->items, i, pair);
}
-
- rb_iv_set (self, "@items", o->items);
}
void
}
void
@@
-293,7
+291,7
@@
c_get_empty (VALUE self)
Data_Get_Struct (self, RbVorbisComments, o);
Data_Get_Struct (self, RbVorbisComments, o);
- return
!RARRAY(o->items)->len
;
+ return
RARRAY(o->items)->len ? Qfalse : Qtrue
;
}
/*
}
/*
@@
-355,7
+353,7
@@
c_aset (VALUE self, VALUE key, VALUE value)
}
}
}
}
- tmp = rb_ary_new3 (2,
key
, value);
+ tmp = rb_ary_new3 (2,
rb_str_dup_frozen (key)
, value);
OBJ_FREEZE (tmp);
rb_ary_push (o->items, tmp);
OBJ_FREEZE (tmp);
rb_ary_push (o->items, tmp);
@@
-551,6
+549,9
@@
Init_Comments (VALUE mVorbis)
rb_define_alias (c, "size", "length");
rb_define_alias (c, "each_pair", "each");
rb_define_alias (c, "size", "length");
rb_define_alias (c, "each_pair", "each");
+ rb_define_alias (c, "key?", "has_key?");
+ rb_define_alias (c, "include?", "has_key?");
+ rb_define_alias (c, "member?", "has_key?");
id_casecmp = rb_intern ("casecmp");
id_replace = rb_intern ("replace");
id_casecmp = rb_intern ("casecmp");
id_replace = rb_intern ("replace");