[libcxx-commits] [libcxx] [libc++][NFC] Remove dead code in <list> (PR #65651)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 7 10:58:28 PDT 2023


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/65651:

I came across this function (which is never used) while doing other changes. It should be safe to remove since it's not used anywhere.

>From 0c9d7effea931545fb0f1274949032b37745653b Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 7 Sep 2023 13:57:23 -0400
Subject: [PATCH] [libc++][NFC] Remove dead code in <list>

I came across this function (which is never used) while doing other
changes. It should be safe to remove since it's not used anywhere.
---
 libcxx/include/list | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/libcxx/include/list b/libcxx/include/list
index 37bed3cd89fc96a..77b988cd1ef911b 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -1779,17 +1779,6 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
     }
 }
 
-template <class _Iterator>
-_LIBCPP_HIDE_FROM_ABI
-bool __iterator_in_range(_Iterator __first, _Iterator __last, _Iterator __it) {
-    for (_Iterator __p = __first; __p != __last; ++__p) {
-        if (__p == __it) {
-            return true;
-        }
-    }
-    return false;
-}
-
 template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)



More information about the libcxx-commits mailing list