• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionc141989e152f4874cab63dfab6812920e5c6d0a6 (tree)
Zeit2024-04-06 09:21:01
AutorFs <Fsu0413@vip....>
CommiterFs

Log Message

simplify "if not"

Ändern Zusammenfassung

Diff

--- a/Compile/build.lua
+++ b/Compile/build.lua
@@ -7,10 +7,7 @@ local scriptFile = arg[0]
77 local n, n2
88 repeat
99 n = n2
10- n2 = string.find(scriptFile, "/", n and (n + 1) or 1)
11- if not n2 then
12- n2 = string.find(scriptFile, "\\", n and (n + 1) or 1)
13- end
10+ n2 = string.find(scriptFile, "/", n and (n + 1) or 1) or string.find(scriptFile, "\\", n and (n + 1) or 1)
1411 until not n2
1512
1613 scriptPath = (n and string.sub(scriptFile, 1, n - 1) or ".")
--- a/Compile/lib/CompilerVer.lua
+++ b/Compile/lib/CompilerVer.lua
@@ -68,10 +68,7 @@ end
6868 local gccCommon = function(isWin, executableName)
6969 local script = ""
7070
71- if not executableName then
72- executableName = "gcc"
73- end
74-
71+ executableName = executableName or "gcc"
7572 script = script .. executableName .. " -dumpfullversion -dumpversion"
7673 if isWin then
7774 script = script .. "\r\n"
--- a/Compile/lib/Generate.lua
+++ b/Compile/lib/Generate.lua
@@ -982,18 +982,12 @@ gen.generateBuildCommand = function(self, para)
982982 if para.download and type(para.download) == "table" then
983983 for _, url in ipairs(para.download) do
984984 local filename, tool = filenameAndToolFromUrl(url)
985- if not paraCopy.DOWNLOADPACKAGE then
986- paraCopy.DOWNLOADPACKAGE = ""
987- end
985+ paraCopy.DOWNLOADPACKAGE = paraCopy.DOWNLOADPACKAGE or ""
988986 paraCopy.DOWNLOADPACKAGE = paraCopy.DOWNLOADPACKAGE .. self[para.template].download .. " \"" .. filename .. "\" \"" .. url .. "\"\n"
989- if not paraCopy.UNCOMPRESSPACKAGE then
990- paraCopy.UNCOMPRESSPACKAGE = ""
991- end
987+ paraCopy.UNCOMPRESSPACKAGE = paraCopy.UNCOMPRESSPACKAGE or ""
992988 if tool then
993989 paraCopy.UNCOMPRESSPACKAGE = paraCopy.UNCOMPRESSPACKAGE .. self[para.template].extract[tool] .. " \"" .. filename .. "\"\n"
994- if not paraCopy.DELETEUNCOMPRESSED then
995- paraCopy.DELETEUNCOMPRESSED = ""
996- end
990+ paraCopy.DELETEUNCOMPRESSED = paraCopy.DELETEUNCOMPRESSED or ""
997991 paraCopy.DELETEUNCOMPRESSED = paraCopy.DELETEUNCOMPRESSED .. self[para.template].delete .. " \"" .. filename .. "\"\n"
998992 end
999993 end
@@ -1019,18 +1013,14 @@ gen.generateBuildCommand = function(self, para)
10191013 end
10201014
10211015 local ret = string.gsub(template, "%&([%w_]+)%&", function(s)
1022- if paraCopy[s] then
1023- return paraCopy[s]
1024- else
1025- return ""
1026- end
1016+ return paraCopy[s] or ""
10271017 end)
10281018
10291019 return ret
10301020 end
10311021
10321022 gen.dumpConfTable = function(self, para, indent)
1033- if not indent then indent = 1 end
1023+ indent = indent or 1
10341024
10351025 local returnText = "{\n"
10361026 local keys = {}
--- a/Compile/lib/mariadbCompile/conf.lua
+++ b/Compile/lib/mariadbCompile/conf.lua
@@ -990,9 +990,7 @@ for name, value in pairs(conf) do
990990 value.crossCompile = false
991991 end
992992
993- if not value.variant then
994- value.variant = {}
995- end
993+ value.variant = value.variant or {}
996994
997995 value.binaryPackageUrlunix = "http://10.0.1.6:8080/job/MariaDB/job/" .. name .. "/lastSuccessfulBuild/artifact/buildDir/" .. value.name .. ".tar.xz"
998996 value.sourcePackageUrlunix = "http://10.0.1.6/webdav/sources/mariadb-connector-c-" .. value.mariadbVersion .. "-src.tar.gz"
--- a/Compile/lib/opensslCompile/conf.lua
+++ b/Compile/lib/opensslCompile/conf.lua
@@ -1307,9 +1307,7 @@ for name, value in pairs(conf) do
13071307 value.crossCompile = false
13081308 end
13091309
1310- if not value.variant then
1311- value.variant = {}
1312- end
1310+ value.variant = value.variant or {}
13131311
13141312 value.binaryPackageUrlunix = "http://10.0.1.6:8080/job/OpenSSL/job/" .. name .. "/lastSuccessfulBuild/artifact/buildDir/" .. value.name .. ".tar.xz"
13151313 value.sourcePackageUrlunix = "http://10.0.1.6/webdav/sources/openssl-" .. value.opensslVersion .. ".tar.gz"
--- a/Compile/lib/qtCompile/conf.lua
+++ b/Compile/lib/qtCompile/conf.lua
@@ -6775,9 +6775,7 @@ for name, value in pairs(conf) do
67756775 value.crossCompile = false
67766776 end
67776777
6778- if not value.variant then
6779- value.variant = {}
6780- end
6778+ value.variant = value.variant or {}
67816779
67826780 local qtVersionSplit = split(value.qtVersion, ".")
67836781 local qtSourcePackagePrefix = "qt-everywhere-src-"