Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit b986a76

Browse files
author
Zachary Turner
committed
Rename ArrayRef::keep_front / keep_back to take_front / take_back.
The name decided on was take_, but I only updated it for StringRef and forgot to do it for ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280126 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 63347e9 commit b986a76

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/llvm/ADT/ArrayRef.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,17 @@ namespace llvm {
195195
return slice(0, size() - N);
196196
}
197197

198-
/// \brief Keep the first \p N elements of the array.
198+
/// \brief Return a copy of *this with only the first \p N elements.
199199
LLVM_ATTRIBUTE_UNUSED_RESULT
200-
ArrayRef<T> keep_front(size_t N = 1) const {
200+
ArrayRef<T> take_front(size_t N = 1) const {
201201
if (N >= size())
202202
return *this;
203203
return drop_back(size() - N);
204204
}
205205

206-
/// \brief Keep the last \p N elements of the array.
206+
/// \brief Return a copy of *this with only the last \p N elements.
207207
LLVM_ATTRIBUTE_UNUSED_RESULT
208-
ArrayRef<T> keep_back(size_t N = 1) const {
208+
ArrayRef<T> take_back(size_t N = 1) const {
209209
if (N >= size())
210210
return *this;
211211
return drop_front(size() - N);
@@ -337,17 +337,17 @@ namespace llvm {
337337
return slice(0, this->size() - N);
338338
}
339339

340-
/// \brief Drop everything but the first \p N elements of the array.
340+
/// \brief Return a copy of *this with only the first \p N elements.
341341
LLVM_ATTRIBUTE_UNUSED_RESULT
342-
MutableArrayRef<T> keep_front(size_t N = 1) const {
342+
MutableArrayRef<T> take_front(size_t N = 1) const {
343343
if (N >= this->size())
344344
return *this;
345345
return drop_back(this->size() - N);
346346
}
347347

348-
/// \brief Drop everything but the last \p N elements of the array.
348+
/// \brief Return a copy of *this with only the last \p N elements.
349349
LLVM_ATTRIBUTE_UNUSED_RESULT
350-
MutableArrayRef<T> keep_back(size_t N = 1) const {
350+
MutableArrayRef<T> take_back(size_t N = 1) const {
351351
if (N >= this->size())
352352
return *this;
353353
return drop_front(this->size() - N);

0 commit comments

Comments
 (0)