Remove unecessary check and zeroing of arguments
This function uses its boolean return code to indicate success or failure, which all callers check prior to using any of the referenced arguments. Therefore it's unecessary to zero-out referenced arguments or use intermediate variables.
This commit is contained in:
parent
8382eb0e7e
commit
36e3789e91
1 changed files with 1 additions and 10 deletions
|
@ -406,18 +406,9 @@ void CMscdex::GetDriverInfo (PhysPt data) {
|
|||
|
||||
bool CMscdex::GetCDInfo(Bit8u subUnit, Bit8u& tr1, Bit8u& tr2, TMSF& leadOut) {
|
||||
if (subUnit>=numDrives) return false;
|
||||
uint8_t tr1i;
|
||||
uint8_t tr2i;
|
||||
// Assume Media change
|
||||
cdrom[subUnit]->InitNewMedia();
|
||||
dinfo[subUnit].lastResult = cdrom[subUnit]->GetAudioTracks(tr1i,tr2i,leadOut);
|
||||
if (!dinfo[subUnit].lastResult) {
|
||||
tr1 = tr2 = 0;
|
||||
memset(&leadOut,0,sizeof(leadOut));
|
||||
} else {
|
||||
tr1 = tr1i;
|
||||
tr2 = tr2i;
|
||||
}
|
||||
dinfo[subUnit].lastResult = cdrom[subUnit]->GetAudioTracks(tr1, tr2, leadOut);
|
||||
return dinfo[subUnit].lastResult;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue