From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id BDFF93856DC3; Mon, 6 Jun 2022 18:59:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDFF93856DC3 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Simplify varobj "change" logic X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: c2ebdf6a7def7cc4fda0b965554d259177b2fe26 X-Git-Newrev: a80f2680dbf07c713e3d58bc0906b7ed52f911e2 Message-Id: <20220606185903.BDFF93856DC3@sourceware.org> Date: Mon, 6 Jun 2022 18:59:03 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2022 18:59:03 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da80f2680dbf0= 7c713e3d58bc0906b7ed52f911e2 commit a80f2680dbf07c713e3d58bc0906b7ed52f911e2 Author: Tom Tromey Date: Thu May 26 10:40:32 2022 -0600 Simplify varobj "change" logic =20 varobj used to store 'print_value' as a C string, where NULL was a valid value, and so it had logic to handle this situation. However, at some point this was changed to be a std::string, and so the code can be simplified in this spot. Diff: --- gdb/varobj.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gdb/varobj.c b/gdb/varobj.c index 741fdb6a03b..1aca015a21a 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1344,11 +1344,8 @@ install_new_value (struct varobj *var, struct value = *value, bool initial) { print_value =3D varobj_value_get_print_value (var->value.get (), var->format, var); - if ((var->print_value.empty () && !print_value.empty ()) - || (!var->print_value.empty () && print_value.empty ()) - || (!var->print_value.empty () && !print_value.empty () - && var->print_value !=3D print_value)) - changed =3D true; + if (var->print_value !=3D print_value) + changed =3D true; } var->print_value =3D print_value;