Skip to content

Commit b259199

Browse files
committed
Initialize resultShape directly
1 parent 47398c2 commit b259199

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

mlir/lib/Dialect/Shape/IR/Shape.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,15 +652,10 @@ OpFoldResult BroadcastOp::fold(FoldAdaptor adaptor) {
652652
if (!adaptor.getShapes().front())
653653
return nullptr;
654654

655-
auto firstShape = llvm::to_vector<6>(
655+
SmallVector<int64_t, 6> resultShape(
656656
llvm::cast<DenseIntElementsAttr>(adaptor.getShapes().front())
657657
.getValues<int64_t>());
658658

659-
SmallVector<int64_t, 6> resultShape;
660-
resultShape.clear();
661-
std::copy(firstShape.begin(), firstShape.end(),
662-
std::back_inserter(resultShape));
663-
664659
for (auto next : adaptor.getShapes().drop_front()) {
665660
if (!next)
666661
return nullptr;

0 commit comments

Comments
 (0)