From 1ce14e3321fe9e559d0c05401ec82806d5b493e4 Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Fri, 7 Nov 2014 05:26:41 +0000 Subject: [PATCH] Fix CppCheck 'duplicateExpression' warning BTW, all three cases looks similar. It would be nice to refactor it to avoid repeating code. --- core/globals.cpp | 2 +- core/io/config_file.cpp | 2 +- core/io/resource_format_xml.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/globals.cpp b/core/globals.cpp index 94fa331bed3..a39ace7360f 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -674,7 +674,7 @@ static Variant _decode_variant(const String& p_string) { int w=params[2].to_int(); int h=params[3].to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); return Image(); }; diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index b707fd9c13f..17ee72f2eb7 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -580,7 +580,7 @@ static Variant _decode_variant(const String& p_string) { int w=params[2].to_int(); int h=params[3].to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); return Image(); }; diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index e6eede7de61..2a79e6647d8 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -571,7 +571,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name) int w=width.to_int(); int h=height.to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); r_v=Image(); String sdfsdfg;