File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -382,7 +382,13 @@ public:
382
382
{
383
383
decoded_items[i] = val;
384
384
item_offsets[i] = thread_decoded_offset - assigned_run_begin;
385
- if ((i == DECODED_ITEMS_PER_THREAD - 1 ) && (thread_decoded_offset == assigned_run_end - 1 ))
385
+
386
+ // A thread only needs to fetch the next run if this was not the last loop iteration
387
+ // The cast to int32_t is needed to work around the compiler complaining about "pointless comparison of unsigned
388
+ // integer with zero" when DECODED_ITEMS_PER_THREAD is 1
389
+ const bool may_need_to_fetch_next_run =
390
+ static_cast <int32_t >(i) < (static_cast <int32_t >(DECODED_ITEMS_PER_THREAD) - 1 );
391
+ if (may_need_to_fetch_next_run && (thread_decoded_offset == assigned_run_end - 1 ))
386
392
{
387
393
// We make sure that a thread is not re-entering this conditional when being assigned to the last run already by
388
394
// extending the last run's length to all the thread's item
You can’t perform that action at this time.
0 commit comments