[Android] MediaLibrary: code simplification

Geoffrey Métais geoffrey.metais at gmail.com
Fri Jun 12 10:05:50 CEST 2015


http://livingtao.blogspot.fr/2007/05/myth-defining-loop-variables-inside.html

OK compiler does the job, there is no point declaring first actually.

On Fri, Jun 12, 2015 at 10:03 AM Geoffrey Métais <geoffrey.metais at gmail.com>
wrote:

> yes, object allocation is the heavy part.
>
> But with a single recycled reference, objects are freed immediatly, I
> think it's easier gor GC.
>
> On Fri, Jun 12, 2015 at 9:59 AM Jean-Baptiste Kempf <jb at videolan.org>
> wrote:
>
>> On 12 Jun, Geoffrey Métais wrote :
>> > Yes the last part.
>> >
>> > You can, but I found it cleaner to declare the reference before the
>> loop,
>> > and reuse it for each iteration.
>> > Not a big deal imho
>>
>> Yeah, but I'd love to know which one is the best, though.
>> Because the new is inside the loop, no?
>>
>> With my kindest regards,
>>
>> --
>> Jean-Baptiste Kempf
>> http://www.jbkempf.com/ - +33 672 704 734
>> Sent from my Electronic Device
>> _______________________________________________
>> Android mailing list
>> Android at videolan.org
>> https://mailman.videolan.org/listinfo/android
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20150612/165d96c0/attachment.html>


More information about the Android mailing list