@@ -195,17 +195,17 @@ namespace llvm {
195
195
return slice (0 , size () - N);
196
196
}
197
197
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.
199
199
LLVM_ATTRIBUTE_UNUSED_RESULT
200
- ArrayRef<T> keep_front (size_t N = 1 ) const {
200
+ ArrayRef<T> take_front (size_t N = 1 ) const {
201
201
if (N >= size ())
202
202
return *this ;
203
203
return drop_back (size () - N);
204
204
}
205
205
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.
207
207
LLVM_ATTRIBUTE_UNUSED_RESULT
208
- ArrayRef<T> keep_back (size_t N = 1 ) const {
208
+ ArrayRef<T> take_back (size_t N = 1 ) const {
209
209
if (N >= size ())
210
210
return *this ;
211
211
return drop_front (size () - N);
@@ -337,17 +337,17 @@ namespace llvm {
337
337
return slice (0 , this ->size () - N);
338
338
}
339
339
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.
341
341
LLVM_ATTRIBUTE_UNUSED_RESULT
342
- MutableArrayRef<T> keep_front (size_t N = 1 ) const {
342
+ MutableArrayRef<T> take_front (size_t N = 1 ) const {
343
343
if (N >= this ->size ())
344
344
return *this ;
345
345
return drop_back (this ->size () - N);
346
346
}
347
347
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.
349
349
LLVM_ATTRIBUTE_UNUSED_RESULT
350
- MutableArrayRef<T> keep_back (size_t N = 1 ) const {
350
+ MutableArrayRef<T> take_back (size_t N = 1 ) const {
351
351
if (N >= this ->size ())
352
352
return *this ;
353
353
return drop_front (this ->size () - N);
0 commit comments