[libromdata] ISO, IsoPartition: Simplify the Joliet escape sequence parser a bit.

This commit is contained in:
David Korth 2025-06-08 15:07:14 -04:00
parent 6e7d57282f
commit 4342ce8a1b
2 changed files with 16 additions and 18 deletions

View File

@ -340,25 +340,24 @@ void ISOPrivate::checkVolumeDescriptors(void)
// Check if this is a valid UCS-2 level seqeunce.
// NOTE: Using the highest level specified.
JolietSVDType newType = JolietSVDType::None;
switch (p[2]) {
case '@':
if (jolietSVDType < JolietSVDType::UCS2_Level1) {
jolietSVDType = JolietSVDType::UCS2_Level1;
}
newType = JolietSVDType::UCS2_Level1;
break;
case 'C':
if (jolietSVDType < JolietSVDType::UCS2_Level2) {
jolietSVDType = JolietSVDType::UCS2_Level2;
}
newType = JolietSVDType::UCS2_Level2;
break;
case 'E':
if (jolietSVDType < JolietSVDType::UCS2_Level3) {
jolietSVDType = JolietSVDType::UCS2_Level3;
}
newType = JolietSVDType::UCS2_Level3;
break;
default:
break;
}
if (jolietSVDType < newType) {
jolietSVDType = newType;
}
}
}
break;

View File

@ -225,25 +225,24 @@ IsoPartitionPrivate::IsoPartitionPrivate(IsoPartition *q,
// Check if this is a valid UCS-2 level seqeunce.
// NOTE: Using the highest level specified.
JolietSVDType newType = JolietSVDType::None;
switch (p[2]) {
case '@':
if (jolietSVDType < JolietSVDType::UCS2_Level1) {
jolietSVDType = JolietSVDType::UCS2_Level1;
}
newType = JolietSVDType::UCS2_Level1;
break;
case 'C':
if (jolietSVDType < JolietSVDType::UCS2_Level2) {
jolietSVDType = JolietSVDType::UCS2_Level2;
}
newType = JolietSVDType::UCS2_Level2;
break;
case 'E':
if (jolietSVDType < JolietSVDType::UCS2_Level3) {
jolietSVDType = JolietSVDType::UCS2_Level3;
}
newType = JolietSVDType::UCS2_Level3;
break;
default:
break;
}
if (jolietSVDType < newType) {
jolietSVDType = newType;
}
}
}