REFACTOR: Convert 'if' statement to 'switch' statement.

This commit is contained in:
2017-12-21 04:43:29 +00:00
parent df2fb651e4
commit 9cd1869d1d
55 changed files with 4429 additions and 4192 deletions

View File

@@ -167,17 +167,14 @@ namespace DiscImageChef.Filesystems.LisaFS
if(error != Errno.NoError) return error;
if(xattr == "com.apple.lisa.password" && file.password_valid > 0)
{
buf = new byte[8];
Array.Copy(file.password, 0, buf, 0, 8);
return Errno.NoError;
}
if(xattr == "com.apple.lisa.serial" && file.serial > 0)
{
buf = Encoding.ASCII.GetBytes(file.serial.ToString());
return Errno.NoError;
switch(xattr) {
case "com.apple.lisa.password" when file.password_valid > 0:
buf = new byte[8];
Array.Copy(file.password, 0, buf, 0, 8);
return Errno.NoError;
case "com.apple.lisa.serial" when file.serial > 0:
buf = Encoding.ASCII.GetBytes(file.serial.ToString());
return Errno.NoError;
}
if(!ArrayHelpers.ArrayIsNullOrEmpty(file.LisaInfo) && xattr == "com.apple.lisa.label")