File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,13 @@ module.exports = (plan, limit) => {
70
70
// Reduce until limit reached
71
71
while ( currentCount > limit ) {
72
72
// Select node that helps reaching the limit most effectively without overmerging
73
- const overLimit = limit - currentCount ;
73
+ const overLimit = currentCount - limit ;
74
74
let bestNode = undefined ;
75
75
let bestCost = Infinity ;
76
76
for ( const node of treeMap . values ( ) ) {
77
77
if ( node . entries <= 1 || ! node . children ) continue ;
78
- if ( node . children . length <= 1 ) continue ;
78
+ if ( node . children . length === 0 ) continue ;
79
+ if ( node . children . length === 1 && ! node . value ) continue ;
79
80
// Try to select the node with has just a bit more entries than we need to reduce
80
81
// When just a bit more is over 30% over the limit,
81
82
// also consider just a bit less entries then we need to reduce
You can’t perform that action at this time.
0 commit comments