From 03edddba47fff5d2be18f9dcc6c0f0961d315190 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 1 Jun 2018 12:31:48 +0300 Subject: [PATCH] core: drop unnecessary duplicate check --- modules/core/include/opencv2/core/cvstd.inl.hpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index f1637c4..631fe94 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -77,11 +77,8 @@ inline String::String(const std::string& str) : cstr_(0), len_(0) { - if (!str.empty()) - { - size_t len = str.size(); - if (len) memcpy(allocate(len), str.c_str(), len); - } + size_t len = str.size(); + if (len) memcpy(allocate(len), str.c_str(), len); } inline @@ -99,11 +96,8 @@ inline String& String::operator = (const std::string& str) { deallocate(); - if (!str.empty()) - { - size_t len = str.size(); - if (len) memcpy(allocate(len), str.c_str(), len); - } + size_t len = str.size(); + if (len) memcpy(allocate(len), str.c_str(), len); return *this; } -- 2.7.4