From 2ec7758a9f5564266f5736c249c02d15d8316246 Mon Sep 17 00:00:00 2001
From: arcadia-devtools <arcadia-devtools@yandex-team.ru>
Date: Tue, 1 Mar 2022 14:07:11 +0300
Subject: intermediate changes ref:ca7f4ea59c35451f4846b211a4122df6ab12b4df

---
 contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h')

diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
index 367a5bf1c8..cfaec0ed1e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/search.h
@@ -68,7 +68,7 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _Rando
   const _D1 __len1 = __last1 - __first1;
   if (__len1 < __len2)
     return _VSTD::make_pair(__last1, __last1);
-  const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here
+  const _RandomAccessIterator1 __s = __last1 - _D1(__len2 - 1); // Start of pattern match can't go beyond here
 
   while (true) {
     while (true) {
@@ -83,7 +83,7 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _Rando
     _RandomAccessIterator2 __m2 = __first2;
     while (true) {
       if (++__m2 == __last2)
-        return _VSTD::make_pair(__first1, __first1 + __len2);
+        return _VSTD::make_pair(__first1, __first1 + _D1(__len2));
       ++__m1; // no need to check range on __m1 because __s guarantees we have enough source
       if (!__pred(*__m1, *__m2)) {
         ++__first1;
-- 
cgit v1.2.3