Re: fxcop
Gopal V <gopalv82-/[email protected]>
| Newsgroups | gmane.comp.gnu.dotgnu.developer |
|---|---|
| Message-ID | <[email protected]> |
Hi, > >do you know FxCop? That's an Microsoft tool right ?.. Compare if(val.Length == 0) and if(val == String.Empty) tell me which gives an exception when val is null ? The only change we can do is replace all "" with a String.Empty ... (that is a direct pointer load operation in CVM ... no constructors called) The other change is essentially to be made manually as per the scenario .. FxCop points them out for us. String equals in abstract terms would be "return (str1->length == str2->length) && (memcmp(str1->buf,str2->buf))" .. so String.Empty should be reasonable enough. That all said CVM/JIT should be able to make the change at runtime ... rather than at compile time . (eg see null check removal in libjit). Gopal PS: please check System.Xml for this case of == "" :) __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover