@@ -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