petegoodliffe / PGMidi

PGMidi iOS MIDI library and example code
296 stars 83 forks source link

Useless assignment, possible bug #19

Open Xample opened 8 years ago

Xample commented 8 years ago

https://github.com/petegoodliffe/PGMidi/blob/master/Sources/PGMidi/PGMidi.mm#L437

The assignment is useless, I suspect it should be

self.virtualDestinationEnabled = NO;

[edit] well actually I would even move this statement to the next line, or

    self.virtualDestinationEnabled = virtualDestinationEnabled;

will never be affected. [edit 2] Ok it seems self.virtualDestinationEnabled is taken through an accessor which itself check if

-(BOOL)virtualDestinationEnabled
{
    return virtualDestinationSource != nil;
}

so just no need for the line L437