kdemultimedia3 - patch to fix lockup of audiocd:/ kioslave

Tilman Vogel tilman.vogel at web.de
Sat Sep 23 01:10:07 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Braxton schrieb:
> On Friday 22 September 2006 06:08, Tilman Vogel wrote:
>> +       if(drive->ioctl_device_name && strlen(drive->ioctl_device_name))
>> +         d->cd.setDevice(drive->ioctl_device_name, 50, false);
>> +       else
>> +         d->cd.setDevice(drive->cdda_device_name, 50, false);
> couldn't this be changed to:
> 
> if(drive->ioctl_device_name && drive->ioctl_device_name[0])
>   d->cd.setDevice(drive->ioctl_device_name, 50, false);
> else
>   d->cd.setDevice(drive->cdda_device_name, 50, false);
> 
> why compute the length of the string if you only care if it's empty or not.

Well, you're right. No objections. If you care about that bit of
computational time ;-) Counting the length of something like "" or
"/dev/sg0" won't take much time either, I guess...

On the other hand, why stop here. I guess you can find many more nice
possibilities to optimise code there...

Furthermore, one should maybe also add a check, if
drive->cdda_device_name is valid. Although, the previous version of the
code didn't and seemingly worked in many cases (but mine)...

Cheers,

Tilman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFFHtf9ZPu6Yae8lkRApEGAJ9weFLgoeWt9zTgDTDyXykDH20GJACgn/e3
Cnn4TdUXk97FfpxSSrvmG10=
=yq/5
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list