Mailing List Archive

r3739 - trunk/c_src/KinoSearch/Index
Author: creamyg
Date: 2008-08-19 13:22:51 -0700 (Tue, 19 Aug 2008)
New Revision: 3739

Modified:
trunk/c_src/KinoSearch/Index/LexReader.c
trunk/c_src/KinoSearch/Index/SegInfo.c
Log:
Have SegInfo_Field_Name() return NULL rather than an empty string when
provided with an invalid or unknown field number.


Modified: trunk/c_src/KinoSearch/Index/LexReader.c
===================================================================
--- trunk/c_src/KinoSearch/Index/LexReader.c 2008-08-19 20:04:43 UTC (rev 3738)
+++ trunk/c_src/KinoSearch/Index/LexReader.c 2008-08-19 20:22:51 UTC (rev 3739)
@@ -39,7 +39,7 @@
const CharBuf *field = SegInfo_Field_Name(seg_info, i);
SegLexCache *lex_cache;

- if (!SegLexCache_valid(invindex, seg_info, field))
+ if (!field || !SegLexCache_valid(invindex, seg_info, field))
continue;

lex_cache = SegLexCache_new(invindex, seg_info, field);

Modified: trunk/c_src/KinoSearch/Index/SegInfo.c
===================================================================
--- trunk/c_src/KinoSearch/Index/SegInfo.c 2008-08-19 20:04:43 UTC (rev 3738)
+++ trunk/c_src/KinoSearch/Index/SegInfo.c 2008-08-19 20:22:51 UTC (rev 3739)
@@ -144,13 +144,9 @@
CharBuf*
SegInfo_field_name(SegInfo *self, i32_t field_num)
{
- if (field_num) {
- CharBuf *field_name = (CharBuf*)VA_Fetch(self->by_num, field_num);
- return field_name == NULL ? (CharBuf*)&EMPTY : field_name;
- }
- else {
- return (CharBuf*)∅
- }
+ return field_num
+ ? (CharBuf*)VA_Fetch(self->by_num, field_num)
+ : NULL;
}

i32_t


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits