[cfe-commits] [PATCH] share code between StringRef and ArrayRef

Jay Foad jay.foad at gmail.com
Thu Apr 14 00:56:20 PDT 2011


This patch removes a bit of code from StringRef by making it derive
from ArrayRef<char>.

Comments? OK to commit? The savings aren't huge, so I'm not
particularly wedded to the patch.

Incidentally, I didn't touch StringRef::front(), back() or
operator[](), because they return char, whereas the ArrayRef<char>
implementations would return const char &. My C++ isn't good enough to
work out whether that's an important difference or not.

 ArrayRef.h  |    2 +-
 StringRef.h |   39 +++++++--------------------------------
 2 files changed, 8 insertions(+), 33 deletions(-)

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringref.diff
Type: text/x-patch
Size: 3000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110414/f79e974c/attachment.bin>


More information about the cfe-commits mailing list