mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
avoid Ptr<> == NULL checks
This commit is contained in:
@@ -384,21 +384,14 @@ void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst )
|
||||
if (_src.dims() <= 2)
|
||||
{
|
||||
bool ok = false;
|
||||
Ptr<ParallelLoopBody> body;
|
||||
|
||||
if (body == NULL || ok == false)
|
||||
{
|
||||
ok = false;
|
||||
ParallelLoopBody* p = new LUTParallelBody(src, lut, dst, &ok);
|
||||
body.reset(p);
|
||||
}
|
||||
if (body != NULL && ok)
|
||||
LUTParallelBody body(src, lut, dst, &ok);
|
||||
if (ok)
|
||||
{
|
||||
Range all(0, dst.rows);
|
||||
if (dst.total()>>18)
|
||||
parallel_for_(all, *body, (double)std::max((size_t)1, dst.total()>>16));
|
||||
if (dst.total() >= (size_t)(1<<18))
|
||||
parallel_for_(all, body, (double)std::max((size_t)1, dst.total()>>16));
|
||||
else
|
||||
(*body)(all);
|
||||
body(all);
|
||||
if (ok)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat )
|
||||
return;
|
||||
}
|
||||
Ptr<CvSparseMat> m((CvSparseMat*)cvRead((CvFileStorage*)node.fs, (CvFileNode*)*node));
|
||||
CV_Assert(CV_IS_SPARSE_MAT(m));
|
||||
CV_Assert(CV_IS_SPARSE_MAT(m.get()));
|
||||
m->copyToSparseMat(mat);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user