commit | 173d18179732f9aa08f54a1229e3ba29d5bec2db | [log] [tgz] |
---|---|---|
author | Ed Tanous <ed.tanous@intel.com> | Thu Oct 24 10:03:41 2019 -0700 |
committer | James Feist <james.feist@linux.intel.com> | Mon Nov 11 21:36:30 2019 +0000 |
tree | 23a6129ffbeedc2e56e70258dc0fac731a444d74 | |
parent | 42c201821cca6162da111c1ef77cd85009825308 [diff] |
Add a self check in the copy constructor for qs clang-tidy has checks for bugprone constructs. In this case, self assignment is handled poorly by this object. There is nowhere in the code where we do this, but add the check anyway to silence the warning. Background: https://clang.llvm.org/extra/clang-tidy/checks/bugprone-unhandled-self-assignment.html Tested: clang-tidy now passes. Code still compiles. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I49b6d6e08165b23114a7f46f305523acfbb32241
diff --git a/http/query_string.h b/http/query_string.h index 10753ac..1cc68fb 100644 --- a/http/query_string.h +++ b/http/query_string.h
@@ -326,6 +326,11 @@ QueryString& operator=(const QueryString& qs) { + if (this == &qs) + { + return *this; + } + url = qs.url; keyValuePairs.clear(); for (auto p : qs.keyValuePairs)