Other alternatives though include adding a function to StringMap which gives us what we need, and having this function do the pointer hacking, or simply calling strlen.
On Wed, Apr 26, 2017 at 11:03 AM Scott Smith via Phabricator < revi...@reviews.llvm.org> wrote: > scott.smith added inline comments. > > > ================ > Comment at: source/Utility/ConstString.cpp:49 > + // pointer, we don't need the lock. > const StringPoolEntryType &entry = > GetStringMapEntryFromKeyData(ccstr); > return entry.getKey().size(); > ---------------- > zturner wrote: > > Why do we even have this function which digs into the `StringMap` > internals rather than just calling existing `StringMap` member functions? > Can Can we just delete `GetStringMapEntryFromKeyData` entirely and use > `StringMap::find`? > Probably performance. If we have to call Find, then we have to call hash, > fault in the appropriate bucket, and then finally return the entry that we > already have in hand. Plus we'd need the lock. > > > > Repository: > rL LLVM > > https://reviews.llvm.org/D32306 > > > >
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits