Skip to content

Commit cce1feb

Browse files
authored
[libc++][NFC] Remove some dead code in string (#94893)
It looks like the last references got removed in c747bd0. It removed a __zero() function, which was probably created at some point in the ancient past to optimize copying the string representation. The __zero() function got simplified to an assignment as part of making string constexpr, rendering this code unnecessary.
1 parent 6faae13 commit cce1feb

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

libcxx/include/string

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -868,23 +868,9 @@ private:
868868

869869
static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size.");
870870

871-
union __ulx {
872-
__long __lx;
873-
__short __lxx;
874-
};
875-
876-
enum { __n_words = sizeof(__ulx) / sizeof(size_type) };
877-
878-
struct __raw {
879-
size_type __words[__n_words];
880-
};
881-
882-
struct __rep {
883-
union {
884-
__short __s;
885-
__long __l;
886-
__raw __r;
887-
};
871+
union __rep {
872+
__short __s;
873+
__long __l;
888874
};
889875

890876
__compressed_pair<__rep, allocator_type> __r_;

0 commit comments

Comments
 (0)