[libcxx-commits] [libcxx] d17d89f - [libc++] Remove not needed call to __is_long()

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 16 08:26:17 PST 2021


Author: Nilay Vaish
Date: 2021-11-16T11:26:13-05:00
New Revision: d17d89f4eb62c9a17c98cb069d9b5d85f83a7671

URL: https://github.com/llvm/llvm-project/commit/d17d89f4eb62c9a17c98cb069d9b5d85f83a7671
DIFF: https://github.com/llvm/llvm-project/commit/d17d89f4eb62c9a17c98cb069d9b5d85f83a7671.diff

LOG: [libc++] Remove not needed call to __is_long()

The string is known to be long since __grow_by unconditionally calls
__set_long_cap().

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

Added: 
    

Modified: 
    libcxx/include/string

Removed: 
    


################################################################################
diff  --git a/libcxx/include/string b/libcxx/include/string
index 53b4e09b68f3..5d8473bb7b9c 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -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)


        


More information about the libcxx-commits mailing list