if (index == NULL)
return NULL;
+ if ( index->decoding_table != NULL )
+ {
+ COS_object ret = cos_hash_table_get (index->decoding_table, id);
+ if (ret != NULL)
+ return ret;
+ }
+ else
+ index->decoding_table = cos_make_hash_table ();
+
if (COS_OBJECT_INT_P (id))
{
snprintf(buf, 256, "%ld", cos_int_value (id));
if ( concord_index_strid_get_obj_string (index, id_str, &obj_st) )
return NULL;
- cid = cos_read_char (CONCORD_String_data (&obj_st),
- CONCORD_String_size (&obj_st),
- 0, &end);
- if ( cid >= 0 )
- {
- return cos_make_char (cid);
- }
+ {
+ COS_object obj;
+ cid = cos_read_char (CONCORD_String_data (&obj_st),
+ CONCORD_String_size (&obj_st),
+ 0, &end);
+ if ( cid >= 0 )
+ {
+ obj = cos_make_char (cid);
+ cos_retain_object (id);
+ cos_retain_object (obj);
+ cos_hash_table_put (index->decoding_table, id, obj);
+ return obj;
+ }
+ }
return NULL;
}
if ( ret == NULL )
return NULL;
+ cos_retain_object (object);
cos_retain_object (ret);
cos_hash_table_put (fobj->value_table, object, ret);
return ret;