Fix other issues spotted in code review (which might review in spurious LIMITs being reported in ,LOCAL files). Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
@@ -2791,13 +2791,11 @@ public:
unsigned key = mergeheap[i];
keyBuffer = buffers[key];
keyCursor = cursors[key];
- ret += CKeyLevelManager::checkCount(max);
- if (max)
- {
- if (ret > max)
- return ret;
- max -= ret;
- }
+ unsigned __int64 thisKeyCount = CKeyLevelManager::checkCount(max);
+ ret += thisKeyCount;
+ if (thisKeyCount > max)
+ return ret;
+ max -= thisKeyCount;
}
return ret;