ClangTidy cleanups

1. NULL -> nullptr
2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>()
3. Missing std library includes & prefixes

Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
This commit is contained in:
Sameer Agarwal
2022-02-02 13:17:29 -08:00
parent a35bd1bf90
commit ae65219e04
171 changed files with 1191 additions and 1148 deletions
+14 -15
View File
@@ -235,7 +235,7 @@ void PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
// and return a BlockSparseMatrix with the this block structure. The
// caller owns the result.
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
BlockSparseMatrix*
std::unique_ptr<BlockSparseMatrix>
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
CreateBlockDiagonalMatrixLayout(int start_col_block,
int end_col_block) const {
@@ -270,28 +270,27 @@ PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
// Build a BlockSparseMatrix with the just computed block
// structure.
return new BlockSparseMatrix(block_diagonal_structure);
return std::make_unique<BlockSparseMatrix>(block_diagonal_structure);
}
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
BlockSparseMatrix* PartitionedMatrixView<kRowBlockSize,
kEBlockSize,
kFBlockSize>::CreateBlockDiagonalEtE()
const {
BlockSparseMatrix* block_diagonal =
std::unique_ptr<BlockSparseMatrix>
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
CreateBlockDiagonalEtE() const {
std::unique_ptr<BlockSparseMatrix> block_diagonal =
CreateBlockDiagonalMatrixLayout(0, num_col_blocks_e_);
UpdateBlockDiagonalEtE(block_diagonal);
UpdateBlockDiagonalEtE(block_diagonal.get());
return block_diagonal;
}
template <int kRowBlockSize, int kEBlockSize, int kFBlockSize>
BlockSparseMatrix* PartitionedMatrixView<kRowBlockSize,
kEBlockSize,
kFBlockSize>::CreateBlockDiagonalFtF()
const {
BlockSparseMatrix* block_diagonal = CreateBlockDiagonalMatrixLayout(
num_col_blocks_e_, num_col_blocks_e_ + num_col_blocks_f_);
UpdateBlockDiagonalFtF(block_diagonal);
std::unique_ptr<BlockSparseMatrix>
PartitionedMatrixView<kRowBlockSize, kEBlockSize, kFBlockSize>::
CreateBlockDiagonalFtF() const {
std::unique_ptr<BlockSparseMatrix> block_diagonal =
CreateBlockDiagonalMatrixLayout(num_col_blocks_e_,
num_col_blocks_e_ + num_col_blocks_f_);
UpdateBlockDiagonalFtF(block_diagonal.get());
return block_diagonal;
}