refactor: reduce scope of temporaries when getting dictionary values (#47612)
refactor: reduce scale of temporaries when getting dictionary values Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
6d3eeb46e4
commit
66a89ec38f
3 changed files with 54 additions and 97 deletions
|
@ -237,8 +237,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
[window_ setLevel:NSFloatingWindowLevel];
|
||||
}
|
||||
|
||||
bool focusable;
|
||||
if (options.Get(options::kFocusable, &focusable) && !focusable)
|
||||
if (bool val; options.Get(options::kFocusable, &val) && !val)
|
||||
[window_ setDisableKeyOrMainWindow:YES];
|
||||
|
||||
if (transparent() || !has_frame()) {
|
||||
|
@ -283,12 +282,10 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
// NOTE(@mlaurencin) Spec requirements can be found here:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/open#width
|
||||
constexpr int kMinSizeReqdBySpec = 100;
|
||||
int inner_width = 0;
|
||||
int inner_height = 0;
|
||||
const int inner_width = options.ValueOrDefault(options::kinnerWidth, 0);
|
||||
const int inner_height = options.ValueOrDefault(options::kinnerHeight, 0);
|
||||
bool use_content_size =
|
||||
options.ValueOrDefault(options::kUseContentSize, false);
|
||||
options.Get(options::kinnerWidth, &inner_width);
|
||||
options.Get(options::kinnerHeight, &inner_height);
|
||||
if (inner_width || inner_height) {
|
||||
use_content_size = true;
|
||||
if (inner_width)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue