Skip to content

Commit 4db8b64

Browse files
authored
[clang][bytecode][NFC] Remove redundant initialization (#153400)
`std::make_unique` value-initializes array elements, so we don't need to zero them out manually.
1 parent 5c40133 commit 4db8b64

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang/lib/AST/ByteCode/Descriptor.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,7 @@ bool Descriptor::hasTrivialDtor() const {
473473
bool Descriptor::isUnion() const { return isRecord() && ElemRecord->isUnion(); }
474474

475475
InitMap::InitMap(unsigned N)
476-
: UninitFields(N), Data(std::make_unique<T[]>(numFields(N))) {
477-
std::fill_n(data(), numFields(N), 0);
478-
}
476+
: UninitFields(N), Data(std::make_unique<T[]>(numFields(N))) {}
479477

480478
bool InitMap::initializeElement(unsigned I) {
481479
unsigned Bucket = I / PER_FIELD;

0 commit comments

Comments
 (0)