don't assume we have a valid rntuple in render.cpp
This commit is contained in:
parent
7be716aa5e
commit
0ae49de018
1 changed files with 6 additions and 3 deletions
|
@ -169,7 +169,8 @@ void viewer_jump_to(App_State &app, u64 addr)
|
||||||
internal
|
internal
|
||||||
Page_Info_Node *viewer_jump_to_page(App_State &app, u64 page_idx)
|
Page_Info_Node *viewer_jump_to_page(App_State &app, u64 page_idx)
|
||||||
{
|
{
|
||||||
assert(app.rndata.n_pages > 0);
|
if (app.rndata.n_pages == 0)
|
||||||
|
return nullptr;
|
||||||
page_idx = (page_idx + app.rndata.n_pages) % app.rndata.n_pages;
|
page_idx = (page_idx + app.rndata.n_pages) % app.rndata.n_pages;
|
||||||
|
|
||||||
// @Speed
|
// @Speed
|
||||||
|
@ -188,7 +189,8 @@ Page_Info_Node *viewer_jump_to_page(App_State &app, u64 page_idx)
|
||||||
internal
|
internal
|
||||||
void viewer_jump_to_page_list(App_State &app, u64 page_list_idx)
|
void viewer_jump_to_page_list(App_State &app, u64 page_list_idx)
|
||||||
{
|
{
|
||||||
assert(app.rndata.n_cluster_groups > 0);
|
if (app.rndata.n_cluster_groups == 0)
|
||||||
|
return;
|
||||||
page_list_idx = (page_list_idx + app.rndata.n_cluster_groups) % app.rndata.n_cluster_groups;
|
page_list_idx = (page_list_idx + app.rndata.n_cluster_groups) % app.rndata.n_cluster_groups;
|
||||||
|
|
||||||
Cluster_Group_Info &cg_info = app.rndata.cluster_groups[page_list_idx];
|
Cluster_Group_Info &cg_info = app.rndata.cluster_groups[page_list_idx];
|
||||||
|
@ -200,7 +202,8 @@ void viewer_jump_to_page_list(App_State &app, u64 page_list_idx)
|
||||||
internal
|
internal
|
||||||
void viewer_jump_to_cluster(App_State &app, u64 cluster_idx)
|
void viewer_jump_to_cluster(App_State &app, u64 cluster_idx)
|
||||||
{
|
{
|
||||||
assert(app.rndata.n_clusters > 0);
|
if (app.rndata.n_clusters == 0)
|
||||||
|
return;
|
||||||
cluster_idx = (cluster_idx + app.rndata.n_clusters) % app.rndata.n_clusters;
|
cluster_idx = (cluster_idx + app.rndata.n_clusters) % app.rndata.n_clusters;
|
||||||
|
|
||||||
Cluster_Info &cluster = app.rndata.clusters[cluster_idx];
|
Cluster_Info &cluster = app.rndata.clusters[cluster_idx];
|
||||||
|
|
Loading…
Add table
Reference in a new issue