| ... | ... | @@ -1836,11 +1836,15 @@ pub fn createEnvironFromMap( |
| 1836 | 1836 | break :a .nothing; |
| 1837 | 1837 | }; |
| 1838 | 1838 | |
| 1839 | | const envp_count: usize = @intCast(@as(isize, map.count()) + @as(isize, switch (zig_progress_action) { |
| 1840 | | .add => 1, |
| 1841 | | .delete => -1, |
| 1842 | | .nothing, .edit => 0, |
| 1843 | | })); |
| 1839 | const envp_count: usize = c: { |
| 1840 | var count: usize = map.count(); |
| 1841 | switch (zig_progress_action) { |
| 1842 | .add => count += 1, |
| 1843 | .delete => count -= 1, |
| 1844 | .nothing, .edit => {}, |
| 1845 | } |
| 1846 | break :c count; |
| 1847 | }; |
| 1844 | 1848 | |
| 1845 | 1849 | const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null); |
| 1846 | 1850 | var i: usize = 0; |
| ... | ... | @@ -1901,11 +1905,15 @@ pub fn createEnvironFromExisting( |
| 1901 | 1905 | break :a .nothing; |
| 1902 | 1906 | }; |
| 1903 | 1907 | |
| 1904 | | const envp_count: usize = @intCast(@as(isize, @intCast(existing_count)) + @as(isize, switch (zig_progress_action) { |
| 1905 | | .add => 1, |
| 1906 | | .delete => -1, |
| 1907 | | .nothing, .edit => 0, |
| 1908 | | })); |
| 1908 | const envp_count: usize = c: { |
| 1909 | var count: usize = existing_count; |
| 1910 | switch (zig_progress_action) { |
| 1911 | .add => count += 1, |
| 1912 | .delete => count -= 1, |
| 1913 | .nothing, .edit => {}, |
| 1914 | } |
| 1915 | break :c count; |
| 1916 | }; |
| 1909 | 1917 | |
| 1910 | 1918 | const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null); |
| 1911 | 1919 | var i: usize = 0; |