Commit f0ca378d authored by Peter Geoghegan's avatar Peter Geoghegan

Slightly simplify nbtree split point choice loop.

Spotted during post-commit review of the nbtree deduplication commit
(commit 0d861bbb).
parent 8f4ee44b
...@@ -820,18 +820,14 @@ _bt_bestsplitloc(FindSplitData *state, int perfectpenalty, ...@@ -820,18 +820,14 @@ _bt_bestsplitloc(FindSplitData *state, int perfectpenalty,
penalty = _bt_split_penalty(state, state->splits + i); penalty = _bt_split_penalty(state, state->splits + i);
if (penalty <= perfectpenalty)
{
bestpenalty = penalty;
lowsplit = i;
break;
}
if (penalty < bestpenalty) if (penalty < bestpenalty)
{ {
bestpenalty = penalty; bestpenalty = penalty;
lowsplit = i; lowsplit = i;
} }
if (penalty <= perfectpenalty)
break;
} }
final = &state->splits[lowsplit]; final = &state->splits[lowsplit];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment