[libcxx-commits] [PATCH] D113910: Remove not needed call to __is_long()

Nilay Vaish via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 15 10:00:23 PST 2021


nilayvaish created this revision.
nilayvaish published this revision for review.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113910

Files:
  libcxx/include/string


Index: libcxx/include/string
===================================================================
--- libcxx/include/string
+++ libcxx/include/string
@@ -2658,7 +2658,7 @@
     if (__sz == __cap)
     {
         __grow_by(__cap, 1, __sz, __sz, 0);
-        __is_short = !__is_long();
+        __is_short = false;
     }
     pointer __p;
     if (__is_short)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113910.387294.patch
Type: text/x-patch
Size: 358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211115/0a47e8d2/attachment.bin>


More information about the libcxx-commits mailing list