From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by sourceware.org (Postfix) with ESMTPS id 1B81C384B104 for ; Mon, 20 Apr 2020 12:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1B81C384B104 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dodji@seketeli.org Received: from localhost (91-166-131-130.subs.proxad.net [91.166.131.130]) (Authenticated sender: dodji@seketeli.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id D8501240012; Mon, 20 Apr 2020 12:53:01 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 1A31A581890; Mon, 20 Apr 2020 14:53:01 +0200 (CEST) From: Dodji Seketeli To: Matthias Maennich Cc: libabigail@sourceware.org, gprocida@google.com, kernel-team@android.com Subject: Re: [PATCH] abg-dwarf-reader: simplify symbol map update Organization: Me, myself and I References: <20200420074311.92426-1-maennich@google.com> X-Operating-System: Fedora 33 X-URL: http://www.seketeli.net/~dodji Date: Mon, 20 Apr 2020 14:53:00 +0200 In-Reply-To: <20200420074311.92426-1-maennich@google.com> (Matthias Maennich's message of "Mon, 20 Apr 2020 09:43:11 +0200") Message-ID: <87pnc2e2tv.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 12:53:05 -0000 Matthias Maennich a =C3=A9crit: > For the update of fun_syms_, undefined_fun_syms_, var_syms_, > undefined_var_syms_, there is a pattern in > read_context::load_symbol_maps_from_symtab_section that can be > simplified: We try to find the correct entry and keep the iterator. If > we do not find it, we construct the value vector, find it again and > update the iterator. Eventually we push_back the symbol. That can be > simplified to looking up the value with operator[], which either returns > the existing value or default constructs it. The reference returned is > good for the push_back in any case. > > * src/abg-dwarf-reader.cc > (read_context::load_symbol_maps_from_symtab_section): simplify > symbol map update for fun_syms_, undefined_fun_syms_, var_syms_, > undefined_var_syms_. Applied to master, thanks! Cheers, --=20 Dodji