This project has moved. For the latest updates, please go here.

Small things

Apr 22, 2009 at 12:43 AM

I'm new here, but did a little search on this.

Isn't it waste of computing to do this:
StringBuilder HashStringBuilder = new StringBuilder(_sharedSecret, 2 * 1024);
-Line 1141 Flickr.cs

I mean, isn't 2*1024 always the same? (2048)

Please correct me, if this has some special issue attached to it.

Regards Nicolai
Apr 27, 2009 at 8:31 AM
Yes, you are right. It is just lazy short hand by me so I know how many kilobytes I have initialised something to, in this case 2k.

I'm not 100% sure, but I think the compiler might do this calculation while compiling, but I doubt it slows things down much even if it doesn't.

Apr 27, 2009 at 8:59 AM
Just checked, and the following is the decompiled code via Reflector:

    StringBuilder HashStringBuilder = new StringBuilder(this._sharedSecret, 0x800);

So no need to worry :)