Lines Matching full:minlength
390 CollationWeights::allocWeightsInShortRanges(int32_t n, int32_t minLength) {
391 // See if the first few minLength and minLength+1 ranges have enough weights.
392 for(int32_t i = 0; i < rangeCount && ranges[i].length <= (minLength + 1); ++i) {
394 // Use the first few minLength and minLength+1 ranges.
395 if(ranges[i].length > minLength) {
396 // Reduce the number of weights from the last minLength+1 range
397 // which might sort before some minLength ranges,
398 // so that we use all weights in the minLength ranges.
421 CollationWeights::allocWeightsInMinLengthRanges(int32_t n, int32_t minLength) {
422 // See if the minLength ranges have enough weights
428 ranges[minLengthRangeCount].length == minLength;
433 int32_t nextCountBytes = countBytes(minLength + 1);
436 // Use the minLength ranges. Merge them, and then split again as necessary.
444 // Calculate how to split the range between minLength (count1) and minLength+1 (count2).
452 int32_t count1 = count - count2; // number of minLength weights
471 printf("split the range number %ld (out of %ld minLength ranges) by %ld:%ld\n",
476 ranges[0].end = incWeightByOffset(start, minLength, count1 - 1);
479 ranges[1].start = incWeight(ranges[0].end, minLength);
481 ranges[1].length = minLength; // +1 when lengthened
510 int32_t minLength=ranges[0].length;
512 if(allocWeightsInShortRanges(n, minLength)) { break; }
514 if(minLength == 4) {
522 if(allocWeightsInMinLengthRanges(n, minLength)) { break; }
524 /* no good match, lengthen all minLength ranges and iterate */
526 printf("lengthen the short ranges from %ld bytes to %ld and iterate\n", minLength, minLength+1);
528 for(int32_t i=0; ranges[i].length==minLength; ++i) {