diff options
| author | A2va <[email protected]> | 2023-09-30 18:16:31 +0200 |
|---|---|---|
| committer | A2va <[email protected]> | 2023-09-30 18:18:44 +0200 |
| commit | dbfde8ed4da11fd0221a88bfa267e9cf05457345 (patch) | |
| tree | 4003de077cd6cd503bb2ffb9b03d0481fb53c4ab | |
| parent | 434993362b6c4a6a2f20bd634b71eb4f27221253 (diff) | |
Remove unnecessary underscore
| -rw-r--r-- | tests/modules/table/test.lua | 4 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 6 | ||||
| -rw-r--r-- | xmake/plugins/project/ninja/build_ninja.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/tests/modules/table/test.lua b/tests/modules/table/test.lua index 297832575..2b586e7a4 100644 --- a/tests/modules/table/test.lua +++ b/tests/modules/table/test.lua @@ -33,9 +33,9 @@ end function test_orderkeys(t) -- sort by modulo 2 then from the smallest to largest local f = function(a, b) - if a % 2 == 0 then + if a % 2 == 0 and b % 2 ~= 0 then return true - elseif b % 2 == 0 then + elseif b % 2 == 0 and a % 2 ~= 0 then return false end return a < b diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index e8da135af..4f611368b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1862,7 +1862,7 @@ function _instance:sourcekinds() local sourcekinds = self._SOURCEKINDS if not sourcekinds then sourcekinds = {} - local sourcebatches, _ = self:sourcebatches() + local sourcebatches = self:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do local sourcekind = sourcebatch.sourcekind if sourcekind then diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index e0b12ae1a..8a7eabb78 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -381,7 +381,7 @@ end function _add_target_sources(cmakelists, target, outputdir) local has_cuda = false cmakelists:print("target_sources(%s PRIVATE", target:name()) - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do if _sourcebatch_is_built(sourcebatch) then for _, sourcefile in ipairs(sourcebatch.sourcefiles) do @@ -613,7 +613,7 @@ function _add_target_compile_options(cmakelists, target, outputdir) end -- add cflags/cxxflags for the specific source files - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do if _sourcebatch_is_built(sourcebatch) then for _, sourcefile in ipairs(sourcebatch.sourcefiles) do @@ -837,7 +837,7 @@ function _add_target_link_libraries(cmakelists, target, outputdir) -- add other object files, maybe from custom rules local objectfiles_set = hashset.new() - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do if _sourcebatch_is_built(sourcebatch) then for _, objectfile in ipairs(sourcebatch.objectfiles) do diff --git a/xmake/plugins/project/ninja/build_ninja.lua b/xmake/plugins/project/ninja/build_ninja.lua index 8e5677e45..2e55faf05 100644 --- a/xmake/plugins/project/ninja/build_ninja.lua +++ b/xmake/plugins/project/ninja/build_ninja.lua @@ -366,7 +366,7 @@ function _add_build_for_target(ninjafile, target, outputdir) ninjafile:print("") -- build target objects - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do if _sourcebatch_is_built(sourcebatch) then _add_build_for_objects(ninjafile, target, sourcebatch, outputdir) diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 699b5df47..1735c68a4 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -213,7 +213,7 @@ function _make_custom_commands(target, vcxprojdir) local commands = {} _make_custom_commands_for_target(commands, target, vcxprojdir, "before") _make_custom_commands_for_target(commands, target, vcxprojdir) - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do local rulename = sourcebatch.rulename local sourcekind = sourcebatch.sourcekind @@ -282,7 +282,7 @@ function _make_targetinfo(mode, arch, target, vcxprojdir) local firstcompflags = nil targetinfo.compflags = {} targetinfo.compargvs = {} - local sourcebatches, _ = target:sourcebatches() + local sourcebatches = target:sourcebatches() for _, sourcebatch in table.orderpairs(sourcebatches) do local sourcekind = sourcebatch.sourcekind local rulename = sourcebatch.rulename |
