"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
tog: remove main_view in view_loop()
To:
gameoftrees@openbsd.org
Date:
Sat, 5 Dec 2020 11:48:34 +0100

Download raw body.

Thread
The 'main_view' pointer is no longer relevant.
The existing logic works without it.
 
ok?

diff b3796c3623d628cac6cf2e78b080d7bb9ad3e341 462ea09d21333c2195749a7f910b1d11d704ff39
blob - 72c43370d57131de5f87eef084c18dc57532981b
blob + 1b0640f43a81b338f8a17e05d69615a5fc41c1c8
--- tog/tog.c
+++ tog/tog.c
@@ -959,7 +959,7 @@ view_loop(struct tog_view *view)
 {
 	const struct got_error *err = NULL;
 	struct tog_view_list_head views;
-	struct tog_view *new_view, *main_view;
+	struct tog_view *new_view;
 	int fast_refresh = 10;
 	int done = 0, errcode;
 
@@ -970,7 +970,6 @@ view_loop(struct tog_view *view)
 	TAILQ_INIT(&views);
 	TAILQ_INSERT_HEAD(&views, view, entry);
 
-	main_view = view;
 	view->focussed = 1;
 	err = view->show(view);
 	if (err)
@@ -1001,7 +1000,7 @@ view_loop(struct tog_view *view)
 				TAILQ_REMOVE(&views, view, entry);
 
 			err = view_close(view);
-			if (err || (view == main_view && new_view == NULL))
+			if (err)
 				goto done;
 
 			view = NULL;