Corrections
Support an empty list of entries being added. Also specify a tree correctly in all from_orderedlist scenarios
This commit is contained in:
parent
cc9494735b
commit
2c4c5c9597
2 changed files with 4 additions and 2 deletions
|
@ -263,7 +263,7 @@
|
||||||
{"SST09",
|
{"SST09",
|
||||||
{warn, "Read request exposes slot with bad CRC"}},
|
{warn, "Read request exposes slot with bad CRC"}},
|
||||||
{"SST10",
|
{"SST10",
|
||||||
{info, "Expansion sought to support pointer to pid ~w status ~w"}},
|
{debug, "Expansion sought to support pointer to pid ~w status ~w"}},
|
||||||
|
|
||||||
{"CDB01",
|
{"CDB01",
|
||||||
{info, "Opening file for writing with filename ~s"}},
|
{info, "Opening file for writing with filename ~s"}},
|
||||||
|
|
|
@ -360,7 +360,7 @@ load_level(LevelIdx, Level, PidFun, SQNFun) ->
|
||||||
{L0, MaxSQN} = lists:foldr(LowerLevelLoadFun,
|
{L0, MaxSQN} = lists:foldr(LowerLevelLoadFun,
|
||||||
{[], 0},
|
{[], 0},
|
||||||
leveled_tree:to_list(Level)),
|
leveled_tree:to_list(Level)),
|
||||||
{leveled_tree:from_orderedlist(L0), MaxSQN}
|
{leveled_tree:from_orderedlist(L0, ?TREE_TYPE, ?TREE_WIDTH), MaxSQN}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
close_level(LevelIdx, Level, CloseEntryFun) when LevelIdx =< 1 ->
|
close_level(LevelIdx, Level, CloseEntryFun) when LevelIdx =< 1 ->
|
||||||
|
@ -389,6 +389,8 @@ pred_fun(_LevelIdx, _StartKey, EndKey) ->
|
||||||
EK < EndKey
|
EK < EndKey
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
add_entry(_LevelIdx, Level, []) ->
|
||||||
|
Level;
|
||||||
add_entry(LevelIdx, Level, Entries) when is_list(Entries) ->
|
add_entry(LevelIdx, Level, Entries) when is_list(Entries) ->
|
||||||
FirstEntry = lists:nth(1, Entries),
|
FirstEntry = lists:nth(1, Entries),
|
||||||
PredFun = pred_fun(LevelIdx,
|
PredFun = pred_fun(LevelIdx,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue