From d0ca43e3545c4f01a822cf44d4b44ce88864eeb9 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 3 Sep 2024 08:08:06 -0700 Subject: [PATCH] Quiet some compiler warnings about unmodified variables --- code/cli/munki/shared/updatecheck/analyze.swift | 4 ++-- code/cli/munki/shared/updatecheck/updatecheck.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/cli/munki/shared/updatecheck/analyze.swift b/code/cli/munki/shared/updatecheck/analyze.swift index 3acf600e..cdff9302 100644 --- a/code/cli/munki/shared/updatecheck/analyze.swift +++ b/code/cli/munki/shared/updatecheck/analyze.swift @@ -1011,8 +1011,8 @@ func processRemoval( if !packagesToRemove.isEmpty { // remove references for each package var packagesToReallyRemove = [String]() - var pkgdata = await analyzeInstalledPkgs() - var pkgReferences = pkgdata["pkg_references"] as? [String: [String]] ?? [:] + let pkgdata = await analyzeInstalledPkgs() + let pkgReferences = pkgdata["pkg_references"] as? [String: [String]] ?? [:] var pkgReferencesMessages = [String]() for pkg in packagesToRemove { displayDebug1("Considering \(pkg) for removal...") diff --git a/code/cli/munki/shared/updatecheck/updatecheck.swift b/code/cli/munki/shared/updatecheck/updatecheck.swift index 8378ebcc..f28fe3d5 100644 --- a/code/cli/munki/shared/updatecheck/updatecheck.swift +++ b/code/cli/munki/shared/updatecheck/updatecheck.swift @@ -401,7 +401,7 @@ func checkForUpdates(clientID: String? = nil, localManifestPath: String? = nil) } // verify available license seats for optional installs - if var optionalInstalls = installInfo["optional_installs"] as? [PlistDict], + if let optionalInstalls = installInfo["optional_installs"] as? [PlistDict], !optionalInstalls.isEmpty { installInfo["optional_installs"] = updateAvailableLicenseSeats(optionalInstalls)