From patchwork Thu Jan 23 00:56:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37495 Received: (qmail 82412 invoked by alias); 23 Jan 2020 00:57:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 80550 invoked by uid 89); 23 Jan 2020 00:57:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.87) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 00:57:26 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 297AC477325 for ; Wed, 22 Jan 2020 18:57:25 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id uQoHizIEpERZguQoHirDC9; Wed, 22 Jan 2020 18:57:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=b2otjZsTgIilTiq0qSTAHN7mWyN9lfH9MQF4VxFhcxE=; b=SzMSdnGQ6syrR1ajAIz7yIXtZ1 NoQIkWFJVluK9LZl+PRv7ghRkErlIht7dmgmTwGcuJPvhHG41snft0C4J8uXz+Og0oSOXE8/86zbq 6tGxSCUopnel6G7KJJbgvxYje; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:40828 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1iuQoG-004Kmd-UW; Wed, 22 Jan 2020 17:57:25 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 22/38] Minor simplification in abbrev_table::read Date: Wed, 22 Jan 2020 17:56:54 -0700 Message-Id: <20200123005710.7978-23-tom@tromey.com> In-Reply-To: <20200123005710.7978-1-tom@tromey.com> References: <20200123005710.7978-1-tom@tromey.com> abbrev_table::read increments cur_abbrev->num_attrs in the inner loop, but there's no need to do this, as the information is already stored in the temporary vector. 2020-01-22 Tom Tromey * dwarf2/abbrev.c (abbrev_table::read): Simplify. Change-Id: I765f12850ffa1c6066e884bb22c94468d1abdba4 --- gdb/ChangeLog | 4 ++++ gdb/dwarf2/abbrev.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/dwarf2/abbrev.c b/gdb/dwarf2/abbrev.c index f843e32d950..59ff138b33d 100644 --- a/gdb/dwarf2/abbrev.c +++ b/gdb/dwarf2/abbrev.c @@ -162,9 +162,9 @@ abbrev_table::read (struct objfile *objfile, cur_attr.name = (enum dwarf_attribute) abbrev_name; cur_attr.form = (enum dwarf_form) abbrev_form; cur_attr.implicit_const = implicit_const; - ++cur_abbrev->num_attrs; } + cur_abbrev->num_attrs = cur_attrs.size (); cur_abbrev->attrs = XOBNEWVEC (&abbrev_table->m_abbrev_obstack, struct attr_abbrev, cur_abbrev->num_attrs);