diff options
| author | ruki <[email protected]> | 2025-11-19 22:52:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-19 22:52:32 +0800 |
| commit | db139ec89242d6d0f9b6803c464c5ee68e5a4f41 (patch) | |
| tree | 25776227f359e8da2ce7d9b075a0d744fe5f0d4a /xmake/plugins/format/main.lua | |
| parent | 57639cac99b24fea9073716d95c21357c8b33eac (diff) | |
improve njob
Diffstat (limited to 'xmake/plugins/format/main.lua')
| -rw-r--r-- | xmake/plugins/format/main.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 934535760..aa2814af8 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -211,10 +211,8 @@ function main() -- format files in parallel if #sourcefiles > 0 then - local jobs = option.get("jobs") - if jobs then - jobs = tonumber(jobs) - else + local jobs = tonumber(option.get("jobs")) + if not jobs or jobs <= 0 then jobs = os.default_njob() end local format_time = os.mclock() |
