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 <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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)