Skip to content

Commit

Permalink
use null-coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmexican committed Feb 24, 2025
1 parent 6973317 commit 55f037c
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,10 @@ namespace Mingle {
}
}

private void update_window_title () {
string title = "Mingle: ";
if (left_emoji != null && right_emoji != null) {
title += @"$left_emoji + $right_emoji";
} else if (left_emoji != null) {
title += @"$left_emoji + ?";
} else if (right_emoji != null) {
title += @"? + $right_emoji";
} else {
title += "? + ?";
}
this.set_title (title);
private void update_window_title () {
string ? left = left_emoji?.to_string () ?? "?";
string ? right = right_emoji?.to_string () ?? "?";
this.set_title (@"Mingle: $left + $right");
}

// Toolbar Style
Expand Down

0 comments on commit 55f037c

Please sign in to comment.