Repository: lucy Updated Branches: refs/heads/master 199561eaf -> 7c09f4df5
Switch over to XSBind_hash_key_to_utf8 Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/78a82999 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/78a82999 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/78a82999 Branch: refs/heads/master Commit: 78a82999f9e60c78bb470e99eda82e5446ae4e84 Parents: 35b4c52 Author: Nick Wellnhofer <[email protected]> Authored: Sat Aug 1 17:19:53 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue Aug 4 21:57:40 2015 +0200 ---------------------------------------------------------------------- perl/xs/Lucy/Index/Inverter.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/78a82999/perl/xs/Lucy/Index/Inverter.c ---------------------------------------------------------------------- diff --git a/perl/xs/Lucy/Index/Inverter.c b/perl/xs/Lucy/Index/Inverter.c index dfd436d..eed3a66 100644 --- a/perl/xs/Lucy/Index/Inverter.c +++ b/perl/xs/Lucy/Index/Inverter.c @@ -32,25 +32,10 @@ static lucy_InverterEntry* S_fetch_entry(pTHX_ lucy_Inverter *self, HE *hash_entry) { lucy_InverterIVARS *const ivars = lucy_Inverter_IVARS(self); lucy_Schema *const schema = ivars->schema; - char *key; - STRLEN key_len; - STRLEN he_key_len = HeKLEN(hash_entry); + STRLEN key_size; + const char *key = XSBind_hash_key_to_utf8(aTHX_ hash_entry, &key_size); - // Force field name to UTF-8 if necessary. - if (he_key_len == (STRLEN)HEf_SVKEY) { - SV *key_sv = HeKEY_sv(hash_entry); - key = SvPVutf8(key_sv, key_len); - } - else { - key = HeKEY(hash_entry); - key_len = he_key_len; - if (!cfish_StrHelp_utf8_valid(key, key_len)) { - SV *key_sv = HeSVKEY_force(hash_entry); - key = SvPVutf8(key_sv, key_len); - } - } - - cfish_String *field = CFISH_SSTR_WRAP_UTF8(key, key_len); + cfish_String *field = CFISH_SSTR_WRAP_UTF8(key, key_size); int32_t field_num = LUCY_Seg_Field_Num(ivars->segment, field); if (!field_num) { // This field seems not to be in the segment yet. Try to find it in
