1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

avoid Ptr<> == NULL checks

This commit is contained in:
Alexander Alekhin
2018-09-08 16:49:11 +00:00
parent 64b3c1e691
commit df8b057b44
7 changed files with 14 additions and 21 deletions
+5 -12
View File
@@ -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;
}