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/12 01:25:42 UTC
[lucy-commits] [4/4] git commit: refs/heads/ivars-wip1 - 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/1e3d2bcc
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/1e3d2bcc
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/1e3d2bcc
Branch: refs/heads/ivars-wip1
Commit: 1e3d2bcce471d641de09045b926746bcfbe58da5
Parents: 76e3d04
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Sun Jun 30 10:29:01 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Jul 11 16:12:51 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/1e3d2bcc/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