Fix PR#22433. The algorithm is_partitioned was testing an item in the middle of the sequence twice.

llvm-svn: 227824
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: b9595b79f22b54fc2cd85a2a1d4040d84f08692a
diff --git a/include/algorithm b/include/algorithm
index 9c51284..e8720cc 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -3148,6 +3148,9 @@
     for (; __first != __last; ++__first)
         if (!__pred(*__first))
             break;
+    if ( __first == __last )
+        return true;
+    ++__first;
     for (; __first != __last; ++__first)
         if (__pred(*__first))
             return false;