* encoding.c (rb_enc_find_index): search the encoding which has the
given name and return its index if found, or -1.
* st.c (type_strcasehash): case-insensitive string hash type.
* string.c (rb_str_force_encoding): force encoding of self. this name
comes from [ruby-dev:31894] by Martin Duerst. [ruby-dev:31744]
* include/ruby/encoding.h (rb_enc_find_index, rb_enc_associate_index):
prototyped.
* include/ruby/encoding.h (rb_enc_isctype): direct interface to ctype.
* include/ruby/st.h (st_init_strcasetable): prototyped.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
instead of num_bins for speed. num_entries has less access.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the former may be larger than the latter.
* include/ruby/st.h (CHAR_BIT): get rid of magic number.
* include/ruby/st.h (struct st_table): num_entries never exceed
num_bins.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bitfield. decrease num_bins 1-bit.
* st.c: pack numhash which have 5 or less entries in bins.
(st_init_table_with_size): setup entries_packed flag.
(st_clear): support packed mode.
(st_lookup): ditto.
(st_insert): ditto.
(st_add_direct): ditto.
(st_copy): ditto.
(st_delete): ditto.
(st_foreach): ditto.
(st_reverse_foreach): ditto.
(unpack_entries): new function for converting to unpacked mode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e