You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2013/07/17 16:12:51 UTC
[lucy-commits] [31/34] git commit: refs/heads/master - Use TermInfo accessors in
LexIndex.
Use TermInfo accessors in LexIndex.
Avoid direct struct access for TermInfo instance vars in LexIndex.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/0fc7b134
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/0fc7b134
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/0fc7b134
Branch: refs/heads/master
Commit: 0fc7b134b58839fd997db7cc43a61720b873cc39
Parents: 6346d10
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Sun Jun 30 10:29:01 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Jul 16 16:08:44 2013 -0700
----------------------------------------------------------------------
core/Lucy/Index/LexIndex.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/0fc7b134/core/Lucy/Index/LexIndex.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexIndex.c b/core/Lucy/Index/LexIndex.c
index 3d3200e..923e925 100644
--- a/core/Lucy/Index/LexIndex.c
+++ b/core/Lucy/Index/LexIndex.c
@@ -15,7 +15,6 @@
*/
#define C_LUCY_LEXINDEX
-#define C_LUCY_TERMINFO
#include "Lucy/Util/ToolSet.h"
#include "Lucy/Index/LexIndex.h"
@@ -125,16 +124,18 @@ static void
S_read_entry(LexIndex *self) {
LexIndexIVARS *const ivars = LexIndex_IVARS(self);
InStream *ix_in = ivars->ix_in;
- TermInfoIVARS *const tinfo_ivars = TInfo_IVARS(ivars->tinfo);
+ TermInfo *const tinfo = ivars->tinfo;
int64_t offset = (int64_t)NumUtil_decode_bigend_u64(ivars->offsets + ivars->tick);
InStream_Seek(ix_in, offset);
TermStepper_Read_Key_Frame(ivars->term_stepper, ix_in);
- tinfo_ivars->doc_freq = InStream_Read_C32(ix_in);
- tinfo_ivars->post_filepos = InStream_Read_C64(ix_in);
- tinfo_ivars->skip_filepos = tinfo_ivars->doc_freq >= ivars->skip_interval
- ? InStream_Read_C64(ix_in)
- : 0;
- tinfo_ivars->lex_filepos = InStream_Read_C64(ix_in);
+ int32_t doc_freq = InStream_Read_C32(ix_in);
+ TInfo_Set_Doc_Freq(tinfo, doc_freq);
+ TInfo_Set_Post_FilePos(tinfo, InStream_Read_C64(ix_in));
+ int64_t skip_filepos = doc_freq >= ivars->skip_interval
+ ? InStream_Read_C64(ix_in)
+ : 0;
+ TInfo_Set_Skip_FilePos(tinfo, skip_filepos);
+ TInfo_Set_Lex_FilePos(tinfo, InStream_Read_C64(ix_in));
}
void