Re: [llvm-commits] [llvm] r46625 - /llvm/trunk/include/llvm/ADT/StringMap.h

2008-01-31 Thread Chris Lattner
On Jan 31, 2008, at 3:32 PM, Anton Korobeynikov wrote: > Hello, Chris > >> This sort of thing won't work when the string is empty and checking >> is >> enabled. Maybe something like this is enough: >> if (Key.empty()) return find(0,0); > Will find() operate sane in such case (supplying NULL

Re: [llvm-commits] [llvm] r46625 - /llvm/trunk/include/llvm/ADT/StringMap.h

2008-01-31 Thread Anton Korobeynikov
Hello, Chris > This sort of thing won't work when the string is empty and checking is > enabled. Maybe something like this is enough: >if (Key.empty()) return find(0,0); Will find() operate sane in such case (supplying NULL pointer as input)? -- With best regards, Anton Korobeynikov. Fac

Re: [llvm-commits] [llvm] r46625 - /llvm/trunk/include/llvm/ADT/StringMap.h

2008-01-31 Thread Chris Lattner
> URL: http://llvm.org/viewvc/llvm-project?rev=46625&view=rev > Log: > Add convenient std::string helpers to StringMap. Patch by Mikhail > Glushenkov! Cool. Before David chimes in :) , I'll point out: > > + iterator find(const std::string &Key) { > +const char* key_start = &Key[0]; > +

[llvm-commits] [llvm] r46625 - /llvm/trunk/include/llvm/ADT/StringMap.h

2008-01-31 Thread Anton Korobeynikov
Author: asl Date: Thu Jan 31 17:02:33 2008 New Revision: 46625 URL: http://llvm.org/viewvc/llvm-project?rev=46625&view=rev Log: Add convenient std::string helpers to StringMap. Patch by Mikhail Glushenkov! Modified: llvm/trunk/include/llvm/ADT/StringMap.h Modified: llvm/trunk/include/llvm/AD