[libc++] Remove not needed call to __is_long()
authorNilay Vaish <nilayvaish@google.com>
Tue, 16 Nov 2021 16:25:42 +0000 (11:25 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 16 Nov 2021 16:26:13 +0000 (11:26 -0500)
The string is known to be long since __grow_by unconditionally calls
__set_long_cap().

Differential Revision: https://reviews.llvm.org/D113910

libcxx/include/string

index 53b4e09..5d8473b 100644 (file)
@@ -2658,7 +2658,7 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
     if (__sz == __cap)
     {
         __grow_by(__cap, 1, __sz, __sz, 0);
-        __is_short = !__is_long();
+        __is_short = false;
     }
     pointer __p;
     if (__is_short)