mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
committed by
Daniel Bevenius
parent
048b977d8e
commit
ec76f7cf8f
@@ -26,11 +26,9 @@ function wrapProcessMethods(binding) {
|
||||
}
|
||||
|
||||
function umask(mask) {
|
||||
if (mask === undefined) {
|
||||
// Get the mask
|
||||
return binding.umask(mask);
|
||||
if (mask !== undefined) {
|
||||
mask = validateMode(mask, 'mask');
|
||||
}
|
||||
mask = validateMode(mask, 'mask');
|
||||
return binding.umask(mask);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user