From 856081229f644f3282a3af0f69539da389fd1038 Mon Sep 17 00:00:00 2001 From: NotWearingPants Date: Mon, 4 Oct 2021 15:40:15 +0300 Subject: [PATCH] [IslandWindow.cpp] Avoid double-fetching dropdownDuration (#11383) ## Summary of the Pull Request The code saved `args.DropdownDuration()` to a local and then called the function again, instead of using the local. Changed to use the local. ## PR Checklist * [ ] Closes #xxx * [x] CLA signed * [ ] Tests added/passed * [ ] Documentation updated * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. ## Detailed Description of the Pull Request / Additional comments I think this getter simply accesses a member on `args`, it doesn't parse the settings or anything, so compiler optimizes it, but seemed to make more sense to use the local. --- src/cascadia/WindowsTerminal/IslandWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index 8fc7e78d3..16ac019af 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -1191,7 +1191,7 @@ void IslandWindow::_summonWindowRoutineBody(Remoting::SummonWindowBehavior args) { uint32_t actualDropdownDuration = args.DropdownDuration(); // If the user requested an animation, let's check if animations are enabled in the OS. - if (args.DropdownDuration() > 0) + if (actualDropdownDuration > 0) { BOOL animationsEnabled = TRUE; SystemParametersInfoW(SPI_GETCLIENTAREAANIMATION, 0, &animationsEnabled, 0);