This function has O(1) space and O(rulesSize) time complexity.
*/
-static int numerusHelper(int n, const uchar *rules, uint rulesSize)
+static uint numerusHelper(int n, const uchar *rules, uint rulesSize)
{
- int result = 0;
+ uint result = 0;
uint i = 0;
if (rulesSize == 0)
}
static QString getMessage(const uchar *m, const uchar *end, const char *context,
- const char *sourceText, const char *comment, int numerus)
+ const char *sourceText, const char *comment, uint numerus)
{
const uchar *tn = 0;
uint tn_length = 0;
- int currentNumerus = -1;
for (;;) {
uchar tag = 0;
if (len % 1)
return QString();
m += 4;
- if (++currentNumerus == numerus) {
+ if (!numerus--) {
tn_length = len;
tn = m;
}
if (!numItems)
return QString();
- int numerus = 0;
+ uint numerus = 0;
if (n >= 0)
numerus = numerusHelper(n, numerusRulesArray, numerusRulesLength);