Skip to content

Commit b2b37c6

Browse files
MaleDongaddaleax
MaleDong
authored andcommitted
lib: simplify 'umask'
Just check: if 'mask' is not undefined, just call 'validateMode' and then return the unmask value, we don't need split them into two returns. PR-URL: #26035 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b1a8927 commit b2b37c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/internal/process/main_thread_only.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ function wrapProcessMethods(binding) {
2626
}
2727

2828
function umask(mask) {
29-
if (mask === undefined) {
30-
// Get the mask
31-
return binding.umask(mask);
29+
if (mask !== undefined) {
30+
mask = validateMode(mask, 'mask');
3231
}
33-
mask = validateMode(mask, 'mask');
3432
return binding.umask(mask);
3533
}
3634

0 commit comments

Comments
 (0)