File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,6 @@ identified, been then
9
9
(XMM vector registers
10
10
are...
11
11
programmers software of to some
12
+ appendix at www.agner.org/optimize/cppexamples.zip for how for how
13
+ appendix at www.agner.org/optimize/cppexamples.zip for how for how appendix should
14
+ appendix at www.agner.org/optimize/cppexamples.zip for how for how appendix should for how for how appendix should
Original file line number Diff line number Diff line change @@ -268,28 +268,27 @@ namespace tongrams {
268
268
uint64_t lookup (T gram, Adaptor adaptor)
269
269
{
270
270
static uint64_t word_ids[global::max_order];
271
- uint64_t order =
271
+ uint64_t o =
272
272
m_mapper.map_query (adaptor (gram), word_ids,
273
273
&m_vocab, &m_arrays.front (),
274
274
m_remapping_order);
275
275
276
- if (order == global::not_found) {
276
+ if (o == global::not_found or o > order () ) {
277
277
return global::not_found;
278
278
}
279
- assert (order < m_order);
280
279
281
280
pointer_range r;
282
281
uint64_t pos = word_ids[0 ];
283
- for (uint64_t i = 1 ; i <= order ; ++i) {
282
+ for (uint64_t i = 1 ; i <= o ; ++i) {
284
283
r = m_arrays[i - 1 ].range (pos);
285
284
pos = m_arrays[i].position (r, word_ids[i]);
286
285
if (pos == global::not_found) {
287
286
return global::not_found;
288
287
}
289
288
}
290
289
291
- uint64_t count_rank = m_arrays[order ].count_rank (pos);
292
- return m_distinct_counts.access (order , count_rank);
290
+ uint64_t count_rank = m_arrays[o ].count_rank (pos);
291
+ return m_distinct_counts.access (o , count_rank);
293
292
}
294
293
295
294
inline uint64_t order () const {
You can’t perform that action at this time.
0 commit comments