Skip to content

Commit 3d806bb

Browse files
committed
DRY
1 parent 27300ee commit 3d806bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Application.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ namespace Scratch {
216216

217217
public async bool handle_quit_window (MainWindow window_to_close) {
218218
unowned List<Gtk.Window> windows = get_windows ();
219-
var n_windows = windows.length ();
220-
if (!yield window_to_close.check_unsaved_changes (n_windows == 1)) {
219+
var is_last_window = windows.length () == 1;
220+
if (!yield window_to_close.check_unsaved_changes (is_last_window)) {
221221
return false;
222222
}
223223

224-
if (n_windows == 1) {
224+
if (is_last_window) {
225225
window_to_close.before_quit (); // Update settings
226226
}
227227
// Just destroy window - we have already checked whether any docs need saving

0 commit comments

Comments
 (0)